Skip to content

Commit bda9d27

Browse files
committed
fence_sbd: Pick up the build-time detection on the "initconfdir" in configure.ac
for the sysconfig path so that it'd be friendly as well for other distributions
1 parent 22537ec commit bda9d27

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

agents/sbd/fence_sbd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
PATH_NOT_EXISTS = -1
1616
PATH_NOT_BLOCK = -2
1717

18-
SYSCONFIG_SBD = "/etc/sysconfig/sbd"
18+
SYSCONFIG_SBD = "@INITCONFDIR@/sbd"
1919

2020
def is_block_device(filename):
2121
"""Checks if a given path is a valid block device

configure.ac

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -460,11 +460,11 @@ AM_CONDITIONAL([xvmcompat], [test "x$xvmcompat" == "xyes"])
460460
# Try to detect the appropriate conf dir. Several systems have both /etc/default
461461
# and /etc/sysconfig but latter is always primary.
462462
AC_ARG_VAR(initconfdir, [directory for initscripts configuration])
463-
if test "x$initconfdir" = x && test "x$FENCE_VIRT" = "x1"; then
464-
AC_CHECK_FILE(/etc/conf.d, [initconfdir='$(sysconfdir)/conf.d}'], [# Gentoo/Arch
463+
if test "x$initconfdir" = x; then
464+
initconfdir='$(sysconfdir)/sysconfig' # Set default to $(sysconfdir)/sysconfig
465+
AC_CHECK_FILE(/etc/conf.d, [initconfdir='$(sysconfdir)/conf.d'], [# Gentoo/Arch
465466
AC_CHECK_FILE(/etc/sysconfig, [initconfdir='$(sysconfdir)/sysconfig'], [# RedHat/Fedora/Slax/Mandriva/S
466-
AC_CHECK_FILE(/etc/default, [initconfdir='$(sysconfdir)/default'], [# Debian/Ubuntu
467-
AC_MSG_ERROR([could not determine system initscripts config dir; please set initconfdir manually.])])])])
467+
AC_CHECK_FILE(/etc/default, [initconfdir='$(sysconfdir)/default'], [# Debian/Ubuntu])])])
468468
fi
469469

470470
## *FLAGS handling

make/fencebuild.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ define gen_agent_from_py
88
-e 's#@''LOGDIR@#${LOGDIR}#g' \
99
-e 's#@''SBINDIR@#${sbindir}#g' \
1010
-e 's#@''LIBEXECDIR@#${libexecdir}#g' \
11+
-e 's#@''INITCONFDIR@#${initconfdir}#g' \
1112
-e 's#@''FENCETMPDIR@#${FENCETMPDIR}#g' \
1213
-e 's#@''IPMITOOL_PATH@#${IPMITOOL_PATH}#g' \
1314
-e 's#@''OPENSTACK_PATH@#${OPENSTACK_PATH}#g' \

0 commit comments

Comments
 (0)