Skip to content

Instantly share code, notes, and snippets.

@jahentao
Created April 20, 2019 02:24
Show Gist options
  • Save jahentao/128b34b371b4c6c38de1ea25878a7251 to your computer and use it in GitHub Desktop.
Save jahentao/128b34b371b4c6c38de1ea25878a7251 to your computer and use it in GitHub Desktop.
systemd脚本,适用于CentOS/RHEL7以上,Ubuntu 15以上,Debian8以上
[Unit]
Description=ShadowsocksR client
After=network.target
Wants=network.target
[Service]
Type=forking
PIDFile=/var/run/shadowsocksr.pid
ExecStart=/usr/bin/python /opt/shadowsocksr/shadowsocks/local.py -c /etc/shadowsocks.json -d start
ExecStop=/usr/bin/python /opt/shadowsocksr/shadowsocks/local.py -c /etc/shadowsocks.json -d stop
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=always
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment