From 7a8635e54c753eda9f72925b1481b913095bcacb Mon Sep 17 00:00:00 2001 From: Yifu Yu Date: Mon, 4 Apr 2016 18:52:10 +0800 Subject: [PATCH] Added systemd service file. **This is a shadowsocks server service, not client service.** If you need client service, please modify ssserver to sslocal. For those who wonder why I didn't use the -d start/stop/restart instead of using forking type of service, shadowsocks defaults writes to a log file under daemon mode instead of output to stdout/stderr, which can't be captured by systemd, so I use the simple mode and keep shadowsocks foreground. --- utils/systemd/shadowsocks@.service | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 utils/systemd/shadowsocks@.service diff --git a/utils/systemd/shadowsocks@.service b/utils/systemd/shadowsocks@.service new file mode 100644 index 0000000..d2a28f0 --- /dev/null +++ b/utils/systemd/shadowsocks@.service @@ -0,0 +1,14 @@ +[Unit] +Description=Shadowsocks daemon %i +After=network.target + +[Service] +ExecStart=/usr/local/bin/ssserver -c /etc/shadowsocks/%i.json +Restart=on-failure +KillMode=process +KillSignal=SIGQUIT +TimeoutStopSec=10 + +[Install] +WantedBy=multi-user.target +