Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@ AC_ARG_WITH(configdir,
[ CONFIGDIR="$withval" ]
)

dnl --runstatedir is available as of autoconf 2.70 (2020-12-08). When users
dnl have an older version, they can use our --with-runstatedir.
sbd_runstatedir=""
AC_ARG_WITH([runstatedir],
[AS_HELP_STRING([--with-runstatedir=DIR],
[modifiable per-process data @<:@LOCALSTATEDIR/run@:>@ (ignored if --runstatedir is available)])],
[ sbd_runstatedir="$withval" ]
)

SBD_WATCHDOG_TIMEOUT_DEFAULT=""
AC_ARG_WITH(watchdog-timeout-default,
[ --with-watchdog-timeout-default=SECONDS
Expand Down Expand Up @@ -310,6 +319,16 @@ eval oldincludedir="`eval echo ${oldincludedir}`"
eval infodir="`eval echo ${infodir}`"
eval mandir="`eval echo ${mandir}`"

if [ test "x${runstatedir}" = "x" ]; then
if [ test "x${sbd_runstatedir}" = "x" ]; then
runstatedir="${localstatedir}/run"
else
runstatedir="${sbd_runstatedir}"
fi
fi
eval runstatedir="$(eval echo ${runstatedir})"
AC_SUBST(runstatedir)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you see the expand_path_option thing Ken has just done in pacemaker?
We should as well consider if we want it synced with .../tests/configure.ac - better of course pull straight so that the copy isn't needed - had some issue i don't recall in detail for which this was a quick hack that persisted.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you see the expand_path_option thing Ken has just done in pacemaker?

Alright, noticed it. We can add the same as well.

We should as well consider if we want it synced with .../tests/configure.ac - better of course pull straight so that the copy isn't needed - had some issue i don't recall in detail for which this was a quick hack that persisted.

OK, will add commits to get this synced with that one when everything is fine.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep - will look over it after this PR and try to remember ... in the worst case we can still simply sync ...

AC_SUBST(LIBADD_DL) dnl extra flags for dynamic linking libraries

if test x"${CONFIGDIR}" = x""; then
Expand Down
3 changes: 2 additions & 1 deletion sbd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,8 @@ regression-testing sbd.
export CFLAGS="$RPM_OPT_FLAGS -Wall -Werror"
%configure --with-watchdog-timeout-default=%{watchdog_timeout_default} \
--with-sync-resource-startup-default=%{?with_sync_resource_startup_default:yes}%{!?with_sync_resource_startup_default:no} \
--with-sync-resource-startup-sysconfig=%{sync_resource_startup_sysconfig}
--with-sync-resource-startup-sysconfig=%{sync_resource_startup_sysconfig} \
--with-runstatedir=%{_rundir}
make %{?_smp_mflags}
###########################################################

Expand Down
4 changes: 2 additions & 2 deletions src/sbd.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ RefuseManualStart=true

[Service]
Type=forking
PIDFile=@localstatedir@/run/sbd.pid
PIDFile=@runstatedir@/sbd.pid
EnvironmentFile=-@CONFIGDIR@/sbd
ExecStart=@sbindir@/sbd $SBD_OPTS -p @localstatedir@/run/sbd.pid watch
ExecStart=@sbindir@/sbd $SBD_OPTS -p @runstatedir@/sbd.pid watch
ExecStop=@bindir@/kill -TERM $MAINPID

# Could this benefit from exit codes for restart?
Expand Down
2 changes: 1 addition & 1 deletion src/sbd.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ fi
SBD_DEVS=${SBD_DEVICE%;}
SBD_DEVICE_ARGS="-d ${SBD_DEVS//;/ -d }"

: ${SBD_PIDFILE:=/var/run/sbd.pid}
: ${SBD_PIDFILE:=@runstatedir@/sbd.pid}
SBD_OPTS+=" -p $SBD_PIDFILE"
: ${SBD_PACEMAKER:="true"}
if ocf_is_true "$SBD_PACEMAKER" ; then
Expand Down
4 changes: 2 additions & 2 deletions src/sbd_remote.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ RefuseManualStart=true

[Service]
Type=forking
PIDFile=@localstatedir@/run/sbd.pid
PIDFile=@runstatedir@/sbd.pid
EnvironmentFile=-@CONFIGDIR@/sbd
ExecStart=@sbindir@/sbd $SBD_OPTS -p @localstatedir@/run/sbd.pid watch
ExecStart=@sbindir@/sbd $SBD_OPTS -p @runstatedir@/sbd.pid watch
ExecStop=@bindir@/kill -TERM $MAINPID

# Could this benefit from exit codes for restart?
Expand Down