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

 

posted @ 2017-05-11 00:42  cdongyang  阅读(7358)  评论(0编辑  收藏  举报