Last active
November 9, 2018 15:12
-
-
Save AtomicVar/1e45023da216d8bc9ab1bcc57f970d24 to your computer and use it in GitHub Desktop.
Shadowsocks Python (3.0.0) systemd service script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Shadowsocks Python local client | |
[Service] | |
Type=forking | |
ExecStart=/path/to/sslocal -c /path/to/config.json -d start | |
ExecReload=/path/to/sslocal -c /path/to/config.json -d restart | |
ExecStop=/path/to/sslocal -c /path/to/config.json -d stop | |
[Install] | |
WantedBy=multi-user.target |
Shadowsocks-libev 配置文件
[Unit]
Description=Shadowsocks-libev local client
[Service]
Type=forking
ExecStart=/path/to/ss-local -c /path/to/config.json -f /path/to/pidfile
ExecReload=/path/to/ss-local -c /path/to/config.json -f /path/to/pidfile
ExecStop=/path/to/ss-local -c /path/to/config.json -f /path/to/pidfile
[Install]
WantedBy=multi-user.target
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note
此脚本测试于:
Shadowsocks版本为Python版(shadowsocks==3.0.0)
Steps
/lib/systemd/system
目录下(其他系统类似)。sudo systemctl daemon-reload
重新加载配置文件使之生效。sudo systemctl enable sslocal
使之开机启动。FAQ
Service failed
若Shadowsocks被安装在了个人目录的
site-packages
下,则需要在系统的/usr/local/lib/python2.7/dist-packages
下为Shadowsocks目录建立符号链接,否则系统以root来运行时将找不到对应版本。