加若格网站做么样,烟台企业网站开发,长沙营销型网站,注册网站商标Ubuntu设置开机执行sh脚本
/etc/systemd/system 目录下新增后缀 service文件#xff0c;eg: start.service ,文件内容如下
[Unit]Description描述信息
Afternetwork.target[Service]# 需要执行的sh文件路径,需要绝对路径
ExecStart/usr/xxx/start.shKillModenone
Restarton-…Ubuntu设置开机执行sh脚本
/etc/systemd/system 目录下新增后缀 service文件eg: start.service ,文件内容如下
[Unit]Description描述信息
Afternetwork.target[Service]# 需要执行的sh文件路径,需要绝对路径
ExecStart/usr/xxx/start.shKillModenone
Restarton-failure
RestartSec20s[Install]
WantedBydefault.target
文件生效
systemctl daemon-reload添加开机自启
systemctl enable start.service