update service file use ssservice.

remove some wrong parameters.
This commit is contained in:
wevsty
2022-01-03 09:58:31 +08:00
committed by ty
parent 15a0a3a172
commit 17ae98899d
6 changed files with 9 additions and 10 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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
}

View File

@@ -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

View File

@@ -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