@@ -834,12 +834,55 @@ AC_DEFINE_UNQUOTED([PACEMAKER_CONFIG_DIR], ["$PACEMAKER_CONFIG_DIR"],
834
834
[ Where to keep configuration files like authkey] )
835
835
AC_SUBST ( PACEMAKER_CONFIG_DIR )
836
836
837
- AC_DEFINE_UNQUOTED ( [ SBIN_DIR] , [ "$sbindir"] , [ Location for system binaries] )
837
+ # Fedora >=42 makes /usr/sbin a symlink to /usr/bin. It updates the RPM macros
838
+ # to set _sbindir to "${_exec_prefix}/bin", the same value as _bindir.
839
+ # Previously it was set to "${_exec_prefix}/sbin". (Note that because of the
840
+ # symlink, paths beginning with /usr/sbin remain valid.)
841
+ #
842
+ # This causes problems with bundle resources. Pacemaker automatically generates
843
+ # a configuration for the bundle's container resource. If the bundle contains a
844
+ # primitive and the container's run-command attribute is unset, the generated
845
+ # container resource has its run_cmd attribute set to
846
+ # SBIN_DIR "/" PCMK__SERVER_REMOTED, which is intended as a reasonable default.
847
+ # If SBIN_DIR becomes "/usr/bin" instead of "/usr/sbin", at least two problems
848
+ # can occur:
849
+ # 1. The container resource's digest changes compared to the digest in the
850
+ # resource history entry. Pacemaker interprets this as a configuration
851
+ # change and restarts the container resource.
852
+ # 2. If the container is running a different OS distro or an older version of
853
+ # Fedora, then the new /usr/bin/pacemaker-remoted path may be invalid; the
854
+ # executable was installed at /usr/sbin/pacemaker-remoted, which is NOT a
855
+ # symlink to /usr/bin path. In this case, the container fails to start.
856
+ #
857
+ # We override the value only for the SBIN_DIR constant, which is used only for
858
+ # the sbd path and the default pacemaker-remoted path. There is no need to
859
+ # override sbindir, which would affect installation directories.
860
+ #
861
+ # There is no more specific way than the below, to detect whether the build
862
+ # system has this /usr/sbin vs. /usr/bin change in effect. Thus corner cases are
863
+ # possible when sbindir/bindir are manually specified or in distros with
864
+ # atypical defaults.
865
+ #
866
+ # At time of writing, autoconf is unchanged. However, we perform the override
867
+ # here instead of in the spec file, in case autoconf changes in the future.
868
+ #
869
+ # Note that other distros (for example, RHEL) are likely to incorporate these
870
+ # changes in the future.
871
+ #
872
+ # References:
873
+ # * https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin
874
+ # * https://bodhi.fedoraproject.org/updates/FEDORA-2025-da0a082e66
875
+ # * https://discussion.fedoraproject.org/t/144562
876
+ AS_IF ( [ test x"$sbindir" = x"$bindir" \
877
+ && test x"$sbindir" = x"${exec_prefix}/bin"] ,
878
+ [ SBIN_DIR="${exec_prefix}/sbin"] ,
879
+ [ SBIN_DIR="$sbindir"] )
880
+ AC_DEFINE_UNQUOTED ( [ SBIN_DIR] , [ "$SBIN_DIR"] , [ Location for system binaries] )
838
881
839
882
# Warn about any directories that don't exist (which may be OK)
840
883
for j in prefix exec_prefix bindir sbindir libexecdir datadir sysconfdir \
841
884
sharedstatedir localstatedir libdir includedir oldincludedir infodir \
842
- mandir INITDIR docdir CONFIGDIR localedir
885
+ mandir INITDIR docdir CONFIGDIR localedir SBIN_DIR
843
886
do
844
887
dirname=`eval echo '${'${j}'}'`
845
888
AS_IF ( [ test -n "$dirname" && test ! -d "$dirname"] ,
0 commit comments