From 65a15b1356c24a1c66fc70f07363012086d62348 Mon Sep 17 00:00:00 2001 From: Boyuan Yang <073plan@gmail.com> Date: Sun, 27 Sep 2015 14:41:06 +0800 Subject: [PATCH] make Debian systemd service use /etc/default conf. --- debian/shadowsocks-libev.default | 2 ++ debian/shadowsocks-libev.service | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/debian/shadowsocks-libev.default b/debian/shadowsocks-libev.default index ca9a19a5..4d2b9cd9 100644 --- a/debian/shadowsocks-libev.default +++ b/debian/shadowsocks-libev.default @@ -5,6 +5,8 @@ # # This is a POSIX shell fragment # +# Note: `START', `GROUP' and `MAXFD' options are not recognized by systemd. +# Please change those settings in the corresponding systemd unit file. # Enable during startup? START=yes diff --git a/debian/shadowsocks-libev.service b/debian/shadowsocks-libev.service index c540c537..9277396b 100644 --- a/debian/shadowsocks-libev.service +++ b/debian/shadowsocks-libev.service @@ -5,7 +5,8 @@ # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # -# This file is default for Debian packaging. +# This file is default for Debian packaging. See also +# /etc/default/shadowsocks-libev for environment variables. [Unit] Description=Shadowsocks-libev Default Server Service @@ -13,8 +14,11 @@ After=network.target [Service] Type=simple -User=nobody -ExecStart=/usr/bin/ss-server -c /etc/shadowsocks-libev/config.json +EnvironmentFile=/etc/default/shadowsocks-libev +User=root +#Group=$GROUP +#LimitNOFILE=$MAXFD +ExecStart=/usr/bin/ss-server -a $USER -c $CONFFILE $DAEMON_ARGS [Install] WantedBy=multi-user.target