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