diff -uNr a/configure.ac b/configure.ac --- a/configure.ac 2017-05-03 10:00:54.396040173 +0200 +++ b/configure.ac 2017-05-03 10:07:28.969236697 +0200 @@ -65,6 +65,21 @@ AM_CONDITIONAL(OCFT_FEDORA_CASES, test "x$OCFT_TEST_CASES" = "xfedora" ) AM_CONDITIONAL(OCFT_DEFAULT_CASES, test "x$OCFT_TEST_CASES" = "xdefault" ) +AC_ARG_WITH([systemdsystemunitdir], + [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],, + [with_systemdsystemunitdir=auto]) +AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [ + def_systemdsystemunitdir=$($PKGCONFIG --variable=systemdsystemunitdir systemd) + + AS_IF([test "x$def_systemdsystemunitdir" = "x"], + [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"], + [AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])]) + with_systemdsystemunitdir=no], + [with_systemdsystemunitdir="$def_systemdsystemunitdir"])]) +AS_IF([test "x$with_systemdsystemunitdir" != "xno"], + [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])]) +AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"]) + dnl dnl AM_INIT_AUTOMAKE([1.11.1 foreign dist-bzip2 dist-xz]) dnl @@ -857,6 +872,7 @@ heartbeat/ocf-directories \ heartbeat/ocf-shellfuncs \ heartbeat/shellfuncs \ +systemd/Makefile \ tools/Makefile \ tools/ocf-tester \ tools/ocft/Makefile \ diff -uNr a/heartbeat/clvm b/heartbeat/clvm --- a/heartbeat/clvm 2017-05-03 10:00:54.560038569 +0200 +++ b/heartbeat/clvm 2017-05-03 10:01:13.309855171 +0200 @@ -353,6 +353,18 @@ return $? fi + # systemd drop-in to stop process before storage services during + # shutdown/reboot + if ps -p 1 | grep -q systemd ; then + systemdrundir="/run/systemd/system/resource-agents-deps.target.d" + mkdir "$systemdrundir" + cat > "$systemdrundir/99-clvmd.conf" < "$systemdrundir/99-LVM.conf" <