systemd应用自启动 |
您所在的位置:网站首页 › linux自动启动目录 › systemd应用自启动 |
系统平台:ubuntu18.04 参考: 打包deb:https://blog.csdn.net/u011050845/article/details/125687447 systemctl详解:https://blog.csdn.net/weixin_42553314/article/details/118696635 配置文件在/lib/systemd/system下新建test.service配置文件 [Unit] Description=test [Service] Type=simple User=sy Restart=on-failure RestartSec=5s ExecStart=/usr/bin/test.sh [Install] WantedBy=multi-user.target创建test.sh脚本用来启动应用,注意脚本和应用的可执行权限。 #!/bin/bash /usr/bin/test & wait如果想让应用开机自启动,在/etc/systemd/system/multi-user.target.wants创建一个test.service的软链接。 ln -s /lib/systemd/system/test.service test.service |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |