1、创建 rc-local.service 文件
2、添加如下内容
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
SysVStartPriority=99
[Install]
WantedBy=mutil-user.target
3、在/etc目录下创建rc.local文件
4、添加你要运行的程序
5、给 rc.local 加上执行权限<