From 824b9dc3b0c7e2c766ace12785b9e0b9b70da7d0 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Sat, 14 Jan 2017 09:30:08 +0800 Subject: [PATCH] Revert "debian/shadowsocks-libev.{default,init,service}: Run service as non-root" This reverts commit 9e31cae042fcbb3238f1d0c11f321f582ec173a3. --- debian/shadowsocks-libev.default | 4 ++-- debian/shadowsocks-libev.init | 8 ++++---- debian/shadowsocks-libev.service | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/debian/shadowsocks-libev.default b/debian/shadowsocks-libev.default index 4d74ecea..7542b314 100644 --- a/debian/shadowsocks-libev.default +++ b/debian/shadowsocks-libev.default @@ -18,8 +18,8 @@ CONFFILE="/etc/shadowsocks-libev/config.json" DAEMON_ARGS="-u" # User and group to run the server as -USER=nobody -GROUP=nogroup +USER=root +GROUP=root # Number of maximum file descriptors MAXFD=32768 diff --git a/debian/shadowsocks-libev.init b/debian/shadowsocks-libev.init index df334dd8..5e2f5441 100644 --- a/debian/shadowsocks-libev.init +++ b/debian/shadowsocks-libev.init @@ -29,8 +29,8 @@ SCRIPTNAME=/etc/init.d/$NAME [ "$START" = "yes" ] || exit 0 -: ${USER:="nobody"} -: ${GROUP:="nogroup"} +: ${USER:="root"} +: ${GROUP:="root"} # Load the VERBOSE setting and other rcS variables . /lib/init/vars.sh @@ -55,9 +55,9 @@ do_start() # 0 if daemon has been started # 1 if daemon was already running # 2 if daemon could not be started - start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$GROUP --exec $DAEMON --test > /dev/null \ + start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid root:$GROUP --exec $DAEMON --test > /dev/null \ || return 1 - start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$GROUP --exec $DAEMON -- \ + start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid root:$GROUP --exec $DAEMON -- \ -c "$CONFFILE" -a "$USER" -u -f $PIDFILE $DAEMON_ARGS \ || return 2 } diff --git a/debian/shadowsocks-libev.service b/debian/shadowsocks-libev.service index ce288151..4887b593 100644 --- a/debian/shadowsocks-libev.service +++ b/debian/shadowsocks-libev.service @@ -16,7 +16,7 @@ After=network.target [Service] Type=simple EnvironmentFile=/etc/default/shadowsocks-libev -User=nobody +User=root LimitNOFILE=32768 ExecStart=/usr/bin/ss-server -a $USER -c $CONFFILE $DAEMON_ARGS