linux service新建,启动,自启,错误日志


查看日志:journalctl -xe

重新加载更新了的service:systemctl daemon-reload 

设置ssh.service自启:systemctl enable ssh.service

关闭ssh.service自启:systemctl disable ssh.service

 1 [Unit]
 2 Description=Shadowsocks-libev custom client Service
 3 After=network.target
 4 
 5 [Service]
 6 Type=simple
 7 User=nobody
 8 ExecStart=/usr/local/bin/ss-local -c /etc/shadowsocks/config.json
 9 ExecReload=/bin/kill -HUP $MAINPID
10 ExecStop=/bin/kill -s QUIT $MAINPID 
11 PrivateTmp=true
12 KillMode=process
13 Restart=on-failure
14 RestartSec=5s
15 
16 [Install]
17 WantedBy=multi-user.target
service example

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM