You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recent Debian introduced support of the LSB /run directory, ewhich is mounted as tmpfs FS. Which implies that on startup it's entirely empty. RA named expects to find named pid file in the {/var}/run/named/named.pid and so fails, as /named/ sub-directory doesn't exist.
Here is a small patch to fix the situation.
--- named.orig 2013-11-02 05:28:37.728810791 +0100
+++ named 2013-11-02 23:03:57.000000000 +0100
@@ -202,6 +202,8 @@
# Validate most critical parameters
named_validate_all() {
+ local pid_dir
+
check_binary $OCF_RESKEY_named
check_binary $OCF_RESKEY_rndc
check_binary $OCF_RESKEY_host
@@ -216,6 +218,11 @@
fi
fi
+ pid_dir=`dirname "${OCF_RESKEY_named_pidfile}"`
+ if [ -n "$pid_dir" -a ! -d "$pid_dir" ]; then
+ ocf_log info "PID file directory $pid_dir doesn't exist"
+ fi
+
getent passwd $OCF_RESKEY_named_user >/dev/null 2>&1
if [ ! $? -eq 0 ]; then
ocf_log err "User $OCF_RESKEY_named_user doesn't exist";
@@ -334,7 +341,7 @@
named_start() {
local root_dir_opt
- local pid
+ local pid_dir pid group
root_dir_opt=""
named_status && return $OCF_SUCCESS
@@ -360,6 +367,15 @@
return $OCF_ERR_GENERIC
fi
+ group=`id -gn ${OCF_RESKEY_named_user}`
+ # dirs under [/var]/run can go away on reboots.
+ pid_dir=`dirname "${OCF_RESKEY_named_pidfile}"`
+ if [ ! -d "$pid_dir" ]; then
+ ocf_log info "Creating PID dir: $pid_dir"
+ mkdir -p "$pid_dir"
+ chmod 775 "$pid_dir"
+ chown root:"$group" "$pid_dir" >/dev/null 2>&1 || true
+ fi
pid=`named_getpid`
With regards,
Timur Bakeyev
The text was updated successfully, but these errors were encountered:
@b-a-t , the patch looks ok. Though I'm not sure where does the 775 permission come from. Can you open a pull request too? Thanks and sorry for the delay.
Recent Debian introduced support of the LSB /run directory, ewhich is mounted as tmpfs FS. Which implies that on startup it's entirely empty. RA named expects to find named pid file in the {/var}/run/named/named.pid and so fails, as /named/ sub-directory doesn't exist.
Here is a small patch to fix the situation.
With regards,
Timur Bakeyev
The text was updated successfully, but these errors were encountered: