Centos7 Socks自启动脚本

实现shadowssocks在centos7自启动脚本
By Chn-Student

#which ssserver 找到ss目录
//usr/local/python3/bin/ssserver
#vim /lib/systemd/system/shadowssocks.service
写入以下内容(请根据实际内容修改)

[Unit]
Description=shadowsocks
After=network.target
 
[Service]
User=root
Type=forking
ExecStart=/usr/local/python3/bin/ssserver -c /etc/config.json -d start
ExecReload=/usr/local/python3/bin/ssserver -c /etc/config.json -d restart
ExecStop=/usr/local/python3/bin/ssserver  -c /etc/config.json -d stop
PrivateTmp=true

[Install]
WantedBy=multi-user.target

保存退出

授权 #chmod 754 /lib/systemd/system/shadowsocks.service
启动 #systemctl start shadowsocks.service
//*第一次启动会自动建立软连接
停止 #systemctl stop shadowsocks.service
状态 #systemctl status shadowsocks.service
自启 #systemctl enable shadowsocks.service
关闭自启#systemctl disable shadowsocks.service

标签: centos7, shadowssocks, 自启脚本

添加新评论