mirror of
https://github.com/bol-van/zapret.git
synced 2024-11-26 12:10:53 +03:00
init.d: sysv do not hide error messages from daemons. remove start-stop-daemon
This commit is contained in:
parent
611292281c
commit
a85a0f19da
@ -169,20 +169,16 @@ run_daemon()
|
|||||||
local DAEMONBASE="$(basename "$2")"
|
local DAEMONBASE="$(basename "$2")"
|
||||||
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 [ -f "$PIDFILE" ] && pgrep -F "$PIDFILE" "$DAEMONBASE" >/dev/null; then
|
||||||
start-stop-daemon -S -p "$PIDFILE" -m -b -x "$2" -- $3
|
echo already running
|
||||||
else
|
else
|
||||||
if [ -f "$PIDFILE" ] && pgrep -F "$PIDFILE" "$DAEMONBASE" >/dev/null; then
|
"$2" $3 >/dev/null &
|
||||||
echo already running
|
PID=$!
|
||||||
|
if [ -n "$PID" ]; then
|
||||||
|
echo $PID >$PIDFILE
|
||||||
else
|
else
|
||||||
"$2" $3 >/dev/null 2>/dev/null &
|
echo could not start daemon $1 : $2 $3
|
||||||
PID=$!
|
false
|
||||||
if [ -n "$PID" ]; then
|
|
||||||
echo $PID >$PIDFILE
|
|
||||||
else
|
|
||||||
echo could not start daemon $1 : $2 $3
|
|
||||||
false
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user