Skip to content

Commit

Permalink
API: libcrmcommon: Add PCMK_OCF_ROOT defined constant.
Browse files Browse the repository at this point in the history
  • Loading branch information
clumens committed Aug 20, 2024
1 parent 92bc95a commit f29b64e
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion agents/ocf/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ DBOOK_OPTS = --stringparam command.prefix ocf_pacemaker_ \
--param man.vol 7

ocf_pacemaker_%.xml: %
$(AM_V_GEN)OCF_FUNCTIONS=/dev/null OCF_ROOT=$(OCF_ROOT_DIR) $(abs_builddir)/$< meta-data > $@
$(AM_V_GEN)OCF_FUNCTIONS=/dev/null OCF_ROOT=$(PCMK_OCF_ROOT) $(abs_builddir)/$< meta-data > $@

endif

Expand Down
18 changes: 9 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -440,20 +440,20 @@ dnl /usr/lib rather than libdir because it's determined by the OCF project and
dnl not Pacemaker. Even if a user wants to install Pacemaker to /usr/local or
dnl such, the OCF agents will be expected in their usual location. However, we
dnl do give the user the option to override it.
PKG_CHECK_VAR([OCF_ROOT_DIR], [resource-agents], [ocfrootdir], [],
[OCF_ROOT_DIR="/usr/lib/ocf"])
PKG_CHECK_VAR([PCMK_OCF_ROOT], [resource-agents], [ocfrootdir], [],
[PCMK_OCF_ROOT="/usr/lib/ocf"])
AC_ARG_WITH([ocfdir],
[AS_HELP_STRING([--with-ocfdir=DIR], m4_normalize([
OCF resource agent root directory (advanced option: changing this
may break other cluster components unless similarly configured)
@<:@value from resource-agents package if available otherwise
/usr/lib/ocf@:>@]))],
[ OCF_ROOT_DIR="$withval" ]
[ PCMK_OCF_ROOT="$withval" ]
)

dnl Get default from resource-agents if possible
PKG_CHECK_VAR([PCMK__OCF_RA_PATH], [resource-agents], [ocfrapath], [],
[PCMK__OCF_RA_PATH="$OCF_ROOT_DIR/resource.d"])
[PCMK__OCF_RA_PATH="$PCMK_OCF_ROOT/resource.d"])
AC_ARG_WITH([ocfrapath],
[AS_HELP_STRING([--with-ocfrapath=DIR], m4_normalize([
OCF resource agent directories (colon-separated) to search
Expand All @@ -462,7 +462,7 @@ AC_ARG_WITH([ocfrapath],
[ PCMK__OCF_RA_PATH="$withval" ]
)

OCF_RA_INSTALL_DIR="$OCF_ROOT_DIR/resource.d"
OCF_RA_INSTALL_DIR="$PCMK_OCF_ROOT/resource.d"
AC_ARG_WITH([ocfrainstalldir],
[AS_HELP_STRING([--with-ocfrainstalldir=DIR], m4_normalize([
OCF installation directory for Pacemakers resource agents
Expand Down Expand Up @@ -775,9 +775,9 @@ AC_SUBST(PCMK__FENCE_BINDIR)
AC_DEFINE_UNQUOTED([PCMK__FENCE_BINDIR], ["$PCMK__FENCE_BINDIR"],
[Location for executable fence agents])

expand_path_option OCF_ROOT_DIR
AC_SUBST(OCF_ROOT_DIR)
AC_DEFINE_UNQUOTED([OCF_ROOT_DIR], ["$OCF_ROOT_DIR"],
expand_path_option PCMK_OCF_ROOT
AC_SUBST(PCMK_OCF_ROOT)
AC_DEFINE_UNQUOTED([PCMK_OCF_ROOT], ["$PCMK_OCF_ROOT"],
[OCF root directory for resource agents and libraries])

expand_path_option PCMK__OCF_RA_PATH
Expand Down Expand Up @@ -2175,7 +2175,7 @@ AC_MSG_NOTICE([ Header files = ${includedir}])
AC_MSG_NOTICE([ Arch-independent files = ${datadir}])
AC_MSG_NOTICE([ State information = ${localstatedir}])
AC_MSG_NOTICE([ System configuration = ${sysconfdir}])
AC_MSG_NOTICE([ OCF agents = ${OCF_ROOT_DIR}])
AC_MSG_NOTICE([ OCF agents = ${PCMK_OCF_ROOT}])
AC_MSG_NOTICE([])
AC_MSG_NOTICE([ HA group name = ${CRM_DAEMON_GROUP}])
AC_MSG_NOTICE([ HA user name = ${CRM_DAEMON_USER}])
Expand Down
4 changes: 2 additions & 2 deletions cts/support/LSBDummy.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# Dummy LSB RA. Does nothing but touch and remove a state file
#
# Copyright 2006-2021 the Pacemaker project contributors
# Copyright 2006-2024 the Pacemaker project contributors
#
# The version control history for this file may have further details.
#
Expand All @@ -14,7 +14,7 @@
# Initialization:

desc="Dummy LSB service"
. @OCF_ROOT_DIR@/resource.d/heartbeat/.ocf-directories
. @PCMK_OCF_ROOT@/resource.d/heartbeat/.ocf-directories
: ${HA_VARRUN=/tmp} # Backup in case .ocf-directories doesn't exist

#######################################################################
Expand Down
2 changes: 1 addition & 1 deletion include/crm_config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#undef PACEMAKER_CONFIG_DIR

/* Where OCF resource agents and libraries can be found */
#undef OCF_ROOT_DIR
#undef PCMK_OCF_ROOT

/****** Features ******/

Expand Down
2 changes: 1 addition & 1 deletion lib/services/services_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ add_action_env_vars(const svc_action_t *op)

set_ocf_env("OCF_RA_VERSION_MAJOR", PCMK_OCF_MAJOR_VERSION, NULL);
set_ocf_env("OCF_RA_VERSION_MINOR", PCMK_OCF_MINOR_VERSION, NULL);
set_ocf_env("OCF_ROOT", OCF_ROOT_DIR, NULL);
set_ocf_env("OCF_ROOT", PCMK_OCF_ROOT, NULL);
set_ocf_env("OCF_EXIT_REASON_PREFIX", PCMK_OCF_REASON_PREFIX, NULL);

if (op->rsc) {
Expand Down
2 changes: 1 addition & 1 deletion python/pacemaker/buildoptions.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class BuildOptions:
OCF_RA_INSTALL_DIR = "@OCF_RA_INSTALL_DIR@"
"""Where resource agents are installed."""

OCF_ROOT_DIR = "@OCF_ROOT_DIR@"
OCF_ROOT_DIR = "@PCMK_OCF_ROOT@"
"""Root directory for OCF resource agents and libraries."""

RSC_TMP_DIR = "@PCMK__OCF_TMP_DIR@"
Expand Down
2 changes: 1 addition & 1 deletion tools/cibsecret.in
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ check_env
umask 0077

# for dirname() function (@TODO why are we replacing dirname?)
. "@OCF_ROOT_DIR@/lib/heartbeat/ocf-shellfuncs"
. "@PCMK_OCF_ROOT@/lib/heartbeat/ocf-shellfuncs"

"cibsecret_$cmd" "$value" $#
rc=$?
Expand Down

0 comments on commit f29b64e

Please sign in to comment.