mirror of
https://github.com/bol-van/zapret.git
synced 2025-04-19 21:42:59 +03:00
sysv: remove daemonize. use pgrep to detect already running state
This commit is contained in:
parent
bce09d0772
commit
e786abbbdc
@ -109,7 +109,7 @@ run_daemon()
|
|||||||
if exists start-stop-daemon ; then
|
if exists start-stop-daemon ; then
|
||||||
start-stop-daemon --start --pidfile "$PIDFILE" --background --make-pidfile --exec "$2" -- $3 || true
|
start-stop-daemon --start --pidfile "$PIDFILE" --background --make-pidfile --exec "$2" -- $3 || true
|
||||||
else
|
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
|
echo already running
|
||||||
else
|
else
|
||||||
nohup "$2" $3 >/dev/null 2>/dev/null &
|
nohup "$2" $3 >/dev/null 2>/dev/null &
|
||||||
|
Loading…
x
Reference in New Issue
Block a user