Skip to content

Instantly share code, notes, and snippets.

@nooop3
Created October 28, 2015 07:27
Show Gist options
  • Save nooop3/6565028b436be999aa4f to your computer and use it in GitHub Desktop.
Save nooop3/6565028b436be999aa4f to your computer and use it in GitHub Desktop.
Shadsocks client service for CentOS 7. Touch file /etc/shadowsocks/config.json, and copy this to /etc/systemd/system/shadowsocks-client.service. After of all, type systemctl start shadowsocks-client and systemctl enable shadowsocks-client to add it to startup.
[Unit]
Description=Shadowsocks Client
After=network.target
[Service]
Type=forking
PIDFile=/run/shadowsocks/ss-client.pid
PermissionsStartOnly=yes
ExecStartPre=/bin/mkdir -p /run/shadowsocks
ExecStartPre=/bin/chown root:root /run/shadowsocks
ExecStart=/usr/bin/sslocal --pid-file /var/run/shadowsocks/ss-client.pid -c /etc/shadowsocks/config.json -d start
Restart=on-abort
User=root
Group=root
UMask=0027
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment