X-Git-Url: https://git.tld-linux.org/?p=rc-scripts.git;a=blobdiff_plain;f=lib%2Ffunctions;h=fac4c46e67cfccdca16a3f8369cbc08f803ce7c8;hp=41871391e435759b513ffd5e96343c4a0d7bc018;hb=2d25be2988d266692b556fbcc89c5b9108cf16f8;hpb=0030b343be6a069b470cbf713fd811744d60678a diff --git a/lib/functions b/lib/functions index 4187139..fac4c46 100644 --- a/lib/functions +++ b/lib/functions @@ -607,7 +607,7 @@ _daemon_set_ulimits() { # A function to start a program (now it's useful on read-only filesystem too) daemon() { - local errors="" prog="" end="" waitname="" waittime="" + local errors="" prog="" end="" waitname="" waittime=0 local exit_code=0 local nice=$SERVICE_RUN_NICE_LEVEL local fork user closefds redirfds pidfile makepid chdir=/ @@ -979,6 +979,8 @@ pidofproc() { for p in $(< "${pidfile}"); do [ -z "$(echo "$p" | awk '{gsub(/[0-9]/,"");print;}')" ] && pid="$pid $p" done + else + unset pidfile fi # Next try "pidof" if pidfile is not specified