diff --git a/agents/sbd/fence_sbd.py b/agents/sbd/fence_sbd.py index ee308bd75..2df7cdfd6 100644 --- a/agents/sbd/fence_sbd.py +++ b/agents/sbd/fence_sbd.py @@ -15,7 +15,7 @@ PATH_NOT_EXISTS = -1 PATH_NOT_BLOCK = -2 -SYSCONFIG_SBD = "/etc/sysconfig/sbd" +SYSCONFIG_SBD = "@INITCONFDIR@/sbd" def is_block_device(filename): """Checks if a given path is a valid block device diff --git a/configure.ac b/configure.ac index 6b7322419..9d7458275 100644 --- a/configure.ac +++ b/configure.ac @@ -460,11 +460,11 @@ AM_CONDITIONAL([xvmcompat], [test "x$xvmcompat" == "xyes"]) # Try to detect the appropriate conf dir. Several systems have both /etc/default # and /etc/sysconfig but latter is always primary. AC_ARG_VAR(initconfdir, [directory for initscripts configuration]) -if test "x$initconfdir" = x && test "x$FENCE_VIRT" = "x1"; then - AC_CHECK_FILE(/etc/conf.d, [initconfdir='$(sysconfdir)/conf.d}'], [# Gentoo/Arch +if test "x$initconfdir" = x; then + initconfdir='$(sysconfdir)/sysconfig' # Set default to $(sysconfdir)/sysconfig + AC_CHECK_FILE(/etc/conf.d, [initconfdir='$(sysconfdir)/conf.d'], [# Gentoo/Arch AC_CHECK_FILE(/etc/sysconfig, [initconfdir='$(sysconfdir)/sysconfig'], [# RedHat/Fedora/Slax/Mandriva/S - AC_CHECK_FILE(/etc/default, [initconfdir='$(sysconfdir)/default'], [# Debian/Ubuntu - AC_MSG_ERROR([could not determine system initscripts config dir; please set initconfdir manually.])])])]) + AC_CHECK_FILE(/etc/default, [initconfdir='$(sysconfdir)/default'], [# Debian/Ubuntu])])]) fi ## *FLAGS handling diff --git a/make/fencebuild.mk b/make/fencebuild.mk index 9a3c6d6dd..fe927f7af 100644 --- a/make/fencebuild.mk +++ b/make/fencebuild.mk @@ -8,6 +8,7 @@ define gen_agent_from_py -e 's#@''LOGDIR@#${LOGDIR}#g' \ -e 's#@''SBINDIR@#${sbindir}#g' \ -e 's#@''LIBEXECDIR@#${libexecdir}#g' \ + -e 's#@''INITCONFDIR@#${initconfdir}#g' \ -e 's#@''FENCETMPDIR@#${FENCETMPDIR}#g' \ -e 's#@''IPMITOOL_PATH@#${IPMITOOL_PATH}#g' \ -e 's#@''OPENSTACK_PATH@#${OPENSTACK_PATH}#g' \