贡献者: addis
[Unit]
Description=(description of your program)
[Service]
ExecStart=/路径/命令 参数1 参数2
# 等 15 秒再运行以上命令,防止系统没有加载完成(如网络设置等)
ExecStartPre=/bin/sleep 15
[Install]
WantedBy=multi-user.target
ExecStart
不支持 >
和 |
等
sudo systemctl daemon-reload
使文件生效
sudo systemctl enable 名字.service
就可以设置开机自启服务
disable
不开机自启
status
查看状态
start
启动
stop
停止
restart
停止
ps aux | grep 名字
查看是否在运行
You can start and stop it manually with systemctl start scanner.service and systemctl stop scanner.service and see its status with systemctl status scanner.service.
See Arch Linux help about systemd
 
 
 
 
 
 
 
 
 
 
 
友情链接: 超理论坛 | ©小时科技 保留一切权利