SS多用户版 添加为系统服务脚本

SS多用户版添加为系统服务脚本shadowsocks-py.service
使用 systemctl enable shadowsocks-py
设置开机启动
使用 systemctl start shadowsocks-py
运行ss多用户版
使用 systemctl status shadowsocks-py
查看状态
并且可以指定运行用户组,非常之方便。
(感谢 @kookxiang 大神指导写systemd
服务脚本
[Unit]
Description=Shadowsocks Proxy Services(Py ManyUser)
After=syslog.target
After=network.target
[Service]
Type=simple
User=shadowsocks
Group=shadowsocks
WorkingDirectory=/home/shadowsocks
ExecStart=/usr/bin/python /home/shadowsocks/server.py -c /home/shadowsocks/config.json
ExecReload=/bin/kill -s HUP $MAINPID
ExecStop=/bin/kill -s QUIT $MAINPID
Restart=always
Environment="USER=shadowsocks","HOME=/home/shadowsocks"
[Install]
WantedBy=multi-user.target
将代码内容存为 shadowsocks-py.service
并修改其中的WorkingDirectory
ExecStart
路径 Environment
放到 /etc/systemd/system/
目录内即可食用。