diff --git a/debian/shadowsocks-rust-local@.service b/debian/shadowsocks-rust-local@.service index 550db554..05a99643 100644 --- a/debian/shadowsocks-rust-local@.service +++ b/debian/shadowsocks-rust-local@.service @@ -13,7 +13,7 @@ After=network.target Type=simple CapabilityBoundingSet=CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_BIND_SERVICE -ExecStart=/usr/bin/sslocal --log-without-time -c /etc/shadowsocks-rust/%i.json +ExecStart=/usr/bin/ssservice local --log-without-time -c /etc/shadowsocks-rust/%i.json [Install] WantedBy=multi-user.target diff --git a/debian/shadowsocks-rust-server@.service b/debian/shadowsocks-rust-server@.service index bd106161..0f129e78 100644 --- a/debian/shadowsocks-rust-server@.service +++ b/debian/shadowsocks-rust-server@.service @@ -13,7 +13,7 @@ After=network.target Type=simple CapabilityBoundingSet=CAP_NET_BIND_SERVICE AmbientCapabilities=CAP_NET_BIND_SERVICE -ExecStart=/usr/bin/ssserver --log-without-time -c /etc/shadowsocks-rust/%i.json +ExecStart=/usr/bin/ssservice server --log-without-time -c /etc/shadowsocks-rust/%i.json [Install] WantedBy=multi-user.target diff --git a/debian/shadowsocks-rust.default b/debian/shadowsocks-rust.default index a62325b4..1eb386e0 100644 --- a/debian/shadowsocks-rust.default +++ b/debian/shadowsocks-rust.default @@ -15,7 +15,7 @@ START=yes CONFFILE="/etc/shadowsocks-rust/config.json" # Extra command line arguments -DAEMON_ARGS="-u" +DAEMON_ARGS="--log-without-time" # User and group to run the server as USER=nobody diff --git a/debian/shadowsocks-rust.init b/debian/shadowsocks-rust.init index 44681135..0f58636c 100644 --- a/debian/shadowsocks-rust.init +++ b/debian/shadowsocks-rust.init @@ -16,8 +16,8 @@ PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC=shadowsocks-rust # Introduce a short description here NAME=shadowsocks-rust # Introduce the short server's name here -DAEMON=/usr/bin/ssserver # Introduce the server's location here -DAEMON_ARGS="-u --log-without-time" # Arguments to run the daemon with +DAEMON=/usr/bin/ssservice # Introduce the server's location here +DAEMON_ARGS="--log-without-time" # Arguments to run the daemon with PIDFILE=/var/run/$NAME/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME @@ -55,10 +55,8 @@ 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 \ - || return 1 - start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$GROUP --exec $DAEMON -- \ - -c "$CONFFILE" -u -f $PIDFILE $DAEMON_ARGS \ + start-stop-daemon --start --quiet --pidfile $PIDFILE --chuid $USER:$GROUP --exec $DAEMON server \ + -c "$CONFFILE" -f $PIDFILE $DAEMON_ARGS \ || return 2 } diff --git a/debian/shadowsocks-rust.postinst b/debian/shadowsocks-rust.postinst index 48a3be6e..c39b2af2 100644 --- a/debian/shadowsocks-rust.postinst +++ b/debian/shadowsocks-rust.postinst @@ -21,6 +21,7 @@ pathfind() { case "$1" in configure|reconfigure) pathfind setcap && setcap \ + cap_net_bind_service+ep /usr/bin/ssservice \ cap_net_bind_service+ep /usr/bin/sslocal \ cap_net_bind_service+ep /usr/bin/ssserver if [ ! -f /etc/shadowsocks-rust/config.json ]; then diff --git a/debian/shadowsocks-rust.service b/debian/shadowsocks-rust.service index d80ee271..af56887d 100644 --- a/debian/shadowsocks-rust.service +++ b/debian/shadowsocks-rust.service @@ -14,7 +14,7 @@ EnvironmentFile=/etc/default/shadowsocks-rust User=nobody Group=nogroup LimitNOFILE=32768 -ExecStart=/usr/bin/ssserver --log-without-time -c ${CONFFILE} ${DAEMON_ARGS} +ExecStart=/usr/bin/ssservice server -c ${CONFFILE} ${DAEMON_ARGS} [Install] WantedBy=multi-user.target