mirror of
https://github.com/bol-van/zapret.git
synced 2025-04-19 21:42:59 +03:00
sysv init : remove deprecated --oknodo in start-stop-daemon
This commit is contained in:
parent
b44b5d83bb
commit
838692a814
@ -33,9 +33,6 @@ TPWS_OPT_BASE="--user=$TPWS_USER --bind-addr=127.0.0.1"
|
|||||||
TPWS_OPT_BASE_HTTP="--port=$TPPORT_HTTP $TPWS_OPT_BASE"
|
TPWS_OPT_BASE_HTTP="--port=$TPPORT_HTTP $TPWS_OPT_BASE"
|
||||||
TPWS_OPT_BASE_HTTPS="--port=$TPPORT_HTTPS $TPWS_OPT_BASE"
|
TPWS_OPT_BASE_HTTPS="--port=$TPPORT_HTTPS $TPWS_OPT_BASE"
|
||||||
|
|
||||||
# exit script on any error
|
|
||||||
set -e
|
|
||||||
|
|
||||||
exists()
|
exists()
|
||||||
{
|
{
|
||||||
which $1 >/dev/null 2>/dev/null
|
which $1 >/dev/null 2>/dev/null
|
||||||
@ -110,8 +107,7 @@ run_daemon()
|
|||||||
local PIDFILE=$PIDDIR/$DAEMONBASE$1.pid
|
local PIDFILE=$PIDDIR/$DAEMONBASE$1.pid
|
||||||
echo "Starting daemon $1: $2 $3"
|
echo "Starting daemon $1: $2 $3"
|
||||||
if exists start-stop-daemon ; then
|
if exists start-stop-daemon ; then
|
||||||
start-stop-daemon --start --quiet --pidfile "$PIDFILE" --background --make-pidfile \
|
start-stop-daemon --start --pidfile "$PIDFILE" --background --make-pidfile --exec "$2" -- $3 || true
|
||||||
--exec "$2" -- $3
|
|
||||||
elif exists daemonize ; then
|
elif exists daemonize ; then
|
||||||
daemonize -p "$PIDFILE" "$2" $3
|
daemonize -p "$PIDFILE" "$2" $3
|
||||||
else
|
else
|
||||||
@ -134,8 +130,7 @@ stop_daemon()
|
|||||||
local PIDFILE=$PIDDIR/$DAEMONBASE$1.pid
|
local PIDFILE=$PIDDIR/$DAEMONBASE$1.pid
|
||||||
echo "Stopping daemon $1: $2"
|
echo "Stopping daemon $1: $2"
|
||||||
if exists start-stop-daemon ; then
|
if exists start-stop-daemon ; then
|
||||||
start-stop-daemon --oknodo --stop --quiet --pidfile "$PIDFILE" \
|
start-stop-daemon --stop --pidfile "$PIDFILE" --exec "$2" || true
|
||||||
--exec "$2"
|
|
||||||
else
|
else
|
||||||
if [ -f "$PIDFILE" ]; then
|
if [ -f "$PIDFILE" ]; then
|
||||||
read PID <"$PIDFILE"
|
read PID <"$PIDFILE"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user