Skip to content

Commit

Permalink
fence_sbd: Pick up the build-time detection on the "initconfdir" in c…
Browse files Browse the repository at this point in the history
…onfigure.ac

for the sysconfig path so that it'd be friendly as well for other distributions
  • Loading branch information
liangxin1300 committed Sep 25, 2024
1 parent 22537ec commit bda9d27
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion agents/sbd/fence_sbd.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions make/fencebuild.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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' \
Expand Down

0 comments on commit bda9d27

Please sign in to comment.