From e786abbbdcca9eef86c4fe3cf2e98503d1426e90 Mon Sep 17 00:00:00 2001 From: bolvan Date: Wed, 8 May 2019 13:41:49 +0300 Subject: [PATCH] sysv: remove daemonize. use pgrep to detect already running state --- init.d/sysv/zapret | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.d/sysv/zapret b/init.d/sysv/zapret index c1fe5c8..82b1942 100755 --- a/init.d/sysv/zapret +++ b/init.d/sysv/zapret @@ -109,7 +109,7 @@ run_daemon() if exists start-stop-daemon ; then start-stop-daemon --start --pidfile "$PIDFILE" --background --make-pidfile --exec "$2" -- $3 || true else - if [ -f "$PIDFILE" ] && pgrep -F "$PIDFILE" $(basename "$2") >/dev/null; then + if [ -f "$PIDFILE" ] && pgrep -F "$PIDFILE" "$DAEMONBASE" >/dev/null; then echo already running else nohup "$2" $3 >/dev/null 2>/dev/null &