aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rc.d/init.d/functions3
1 files changed, 3 insertions, 0 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 8c4d2573..9f1c76f1 100644
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -110,6 +110,9 @@ checkpid() {
__pids_var_run() {
local base=${1##*/}
local pid_file=${2:-/var/run/$base.pid}
+ local pid_dir=$(/usr/bin/dirname $pid_file > /dev/null)
+
+ [ -d "$pid_dir" -a ! -r "$pid_dir" ] && return 4
pid=
if [ -f "$pid_file" ] ; then