From 6f8a0aa5c0f6c1e4965e4ce10d62ba83ae9f834e Mon Sep 17 00:00:00 2001 From: David Vossel Date: Mon, 29 Jun 2015 13:10:42 -0500 Subject: [PATCH 3/3] bz1227293-dhcpd-chroot-fix.patch --- heartbeat/dhcpd | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/heartbeat/dhcpd b/heartbeat/dhcpd index 67b529e..89a9578 100755 --- a/heartbeat/dhcpd +++ b/heartbeat/dhcpd @@ -38,6 +38,14 @@ OCF_RESKEY_leases_default="/db/dhcpd.leases" OCF_RESKEY_interface_default="" OCF_RESKEY_includes_default="" +# On some systems, the chrooted default is slightly different. +# Lets do our best to support both by default. +if [ ! -d "$OCF_RESKEY_chrooted_path_default" ]; then + if [ -d "/var/lib/dhcpd" ]; then + OCF_RESKEY_chrooted_path_default="/var/lib/dhcpd" + fi +fi + : ${OCF_RESKEY_binary=${OCF_RESKEY_binary_default}} : ${OCF_RESKEY_pid=${OCF_RESKEY_pid_default}} : ${OCF_RESKEY_user=${OCF_RESKEY_user_default}} @@ -302,7 +310,7 @@ dhcpd_initialize_chroot() { { ocf_exit_reason "could not copy $i to chroot jail"; return $OCF_ERR_GENERIC; } done - libdir=$(basename $(echo /var/lib/dhcp/lib*)) + libdir=$(basename $(echo ${OCF_RESKEY_chrooted_path}/lib*)) if test -x /usr/bin/ldd ; then get_ldd_deps() { @@ -327,7 +335,7 @@ dhcpd_initialize_chroot() { done | sort -u` for i in $cplibs ; do if [ -s "$i" ]; then - cp -pL "$i" "/var/lib/dhcp/$libdir/" || + cp -pL "$i" "${OCF_RESKEY_chrooted_path}/$libdir/" || { ocf_exit_reason "could not copy $i to chroot jail"; return $OCF_ERR_GENERIC; } fi done -- 1.8.4.2