Toggle navigation
首页
登录
我的学习生活记录
这里是SUYE的站点
linux开机服务设置
2021-4-15
夙夜
实际技能
开机服务设置:
使用systemd服务
创建服务文件,放到
/etc/systemd/system/目录下,文件例:
autoruning.server
内容:
[Unit]
Description=
autoruning
daemon
After=syslog.target network.target
Wants=network.target
[Service]
Type=simple
ExecStart= nohup /home/www/webcron/
autoruning
Restart= always
RestartSec=1min
ExecStop=/usr/bin/killall
autoruning
[Install]
WantedBy=multi-user.target
文件创建好后使用以下命令来更新systemd配置:
systemctl daemon-reload
systemctl enable auto_run_script.service
之后可以重启服务器测试:
reboot
/etc/systemd/system//etc/systemd/system//etc/systemd/system//etc/systemd/system//etc/systemd/system//etc/systemd/system//etc/systemd/system//etc/systemd/system//etc/systemd/system//etc/systemd/system/ps auxps auxps aux
标签:
Linux
«
js获取上月/指定月份的最后一天
|
v2ray
»
分类
生活方面(2)
实际技能(99)
发展方向(3)
一些思考(2)
技术思想(1)
硬件相关(1)
存档
2023年4月(1)
2023年3月(1)
2023年2月(1)
2023年1月(3)
2022年12月(3)
2022年10月(5)
2022年9月(3)
2022年8月(2)
2022年7月(1)
2022年6月(4)
2022年4月(4)
2022年3月(1)
2022年2月(4)
2022年1月(1)
2021年12月(2)
2021年11月(8)
2021年10月(2)
2021年8月(7)
2021年6月(2)
2021年5月(5)
2021年4月(3)
2021年3月(10)
2021年1月(20)
2020年12月(13)
2020年4月(2)
2020年3月(1)
2020年1月(1)
2019年12月(2)
2019年10月(1)
2019年9月(2)
2019年4月(1)
2018年11月(1)
2018年4月(1)
链接
搜索