diff --git a/macros.systemd b/macros.systemd index b5a8ed3..5205937 100644 --- a/macros.systemd +++ b/macros.systemd @@ -29,6 +29,7 @@ Requires(preun): systemd \ Requires(postun): systemd \ %_unitdir /usr/lib/systemd/system +%_userunitdir /usr/lib/systemd/user %_presetdir /usr/lib/systemd/system-preset %_udevhwdbdir /usr/lib/udev/hwdb.d %_udevrulesdir /usr/lib/udev/rules.d @@ -36,6 +37,7 @@ Requires(postun): systemd \ %_tmpfilesdir /usr/lib/tmpfiles.d %_sysctldir /usr/lib/sysctl.d %_ntpunitsdir /usr/lib/systemd/ntp-units.d +%_binfmtdir /usr/lib/binfmt.d %service_add_pre() \ test -n "$FIRST_ARG" || FIRST_ARG=$1 \ @@ -57,7 +59,7 @@ else \ for service in %{?*} ; do \ sysv_service=${service%.*} \ if [ ! -e "/var/lib/systemd/migrated/$sysv_service" ]; then \ - services_to_migrate="$services_to_migrate $sysv_service" \ + services_to_migrate="$services_to_migrate $sysv_service" \ fi \ done \ if [ -n "$services_to_migrate" ]; then \ @@ -97,7 +99,7 @@ fi \ test -n "$FIRST_ARG" || FIRST_ARG=$1 \ if [ $FIRST_ARG -eq 0 ]; then \ # Package removal, not upgrade \ - /usr/bin/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \ + /usr/bin/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \ /usr/bin/systemctl stop %{?*} > /dev/null 2>&1 || : \ fi \ %{nil} @@ -108,8 +110,9 @@ test -n "$FIRST_ARG" || FIRST_ARG=$1 \ if [ $FIRST_ARG -ge 1 ]; then \ # Package upgrade, not uninstall \ if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_RESTART_ON_UPDATE" != yes ; then \ - /usr/bin/systemctl try-restart %{?*} >/dev/null 2>&1 || : \ - fi \ + /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : \ + /usr/bin/systemctl try-restart %{?*} >/dev/null 2>&1 || : \ + fi \ else # package uninstall \ for service in %{?*} ; do \ sysv_service=${service%.*} \ @@ -119,6 +122,43 @@ else # package uninstall \ fi \ %{nil} +%systemd_post() \ +if [ $1 -eq 0 ] ; then \ + # Package removal, not upgrade \ + /usr/bin/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \ + /usr/bin/systemctl stop %{?*} > /dev/null 2>&1 || : \ +fi \ +%{nil} + +%systemd_user_post() %systemd_post --user --global %{?*} + +%systemd_preun() \ +if [ $1 -eq 0 ] ; then \ + # Package removal, not upgrade \ + /usr/bin/systemctl --no-reload disable %{?*} > /dev/null 2>&1 || : \ + /usr/bin/systemctl stop %{?*} > /dev/null 2>&1 || : \ +fi \ +%{nil} + +%systemd_user_preun() \ +if [ $1 -eq 0 ] ; then \ + # Package removal, not upgrade \ + systemctl --no-reload --user --global disable %{?*} > /dev/null 2>&1 || : \ +fi \ +%{nil} + +%systemd_postun() \ +/usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : \ +%{nil} + +%systemd_postun_with_restart() \ +@rootbindir@/systemctl daemon-reload >/dev/null 2>&1 || : \ +if [ $1 -ge 1 ] ; then \ + # Package upgrade, not uninstall \ + /usr/bin/systemctl try-restart %{?*} >/dev/null 2>&1 || : \ +fi \ +%{nil} + %udev_hwdb_update() \ /usr/bin/udevadm hwdb --update >/dev/null 2>&1 || : \ %{nil} @@ -130,3 +170,16 @@ fi \ %journal_catalog_update() \ /usr/bin/journalctl --update-catalog >/dev/null 2>&1 || : \ %{nil} + +%tmpfiles_create() \ +/usr/bin/systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \ +%{nil} + +%sysctl_apply() \ +/usr/lib/systemd/systemd-sysctl %{?*} >/dev/null 2>&1 || : \ +%{nil} + +%binfmt_apply() \ +/usr/lib/systemd/systemd-binfmt %{?*} >/dev/null 2>&1 || : \ +%{nil} + diff --git a/systemd-daemon-reload-before-service-restart.patch b/systemd-daemon-reload-before-service-restart.patch deleted file mode 100644 index 03b6c4a..0000000 --- a/systemd-daemon-reload-before-service-restart.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -Naur orig/macros.systemd mod/macros.systemd ---- orig/macros.systemd 2014-10-14 08:54:56.264889350 +0200 -+++ mod/macros.systemd 2014-10-15 13:10:43.134133358 +0200 -@@ -108,6 +108,7 @@ - if [ $FIRST_ARG -ge 1 ]; then \ - # Package upgrade, not uninstall \ - if test "$YAST_IS_RUNNING" != "instsys" -a "$DISABLE_RESTART_ON_UPDATE" != yes ; then \ -+ /usr/bin/systemctl daemon-reload >/dev/null 2>&1 || : \ - /usr/bin/systemctl try-restart %{?*} >/dev/null 2>&1 || : \ - fi \ - else # package uninstall \ diff --git a/systemd-rpm-macros.changes b/systemd-rpm-macros.changes index c05d947..16f20f4 100644 --- a/systemd-rpm-macros.changes +++ b/systemd-rpm-macros.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Nov 18 13:30:37 UTC 2014 - werner@suse.de + +- Apply then delete patch systemd-daemon-reload-before-service-restart.patch +- Add orignal systemd macros as well (boo#807164) + ------------------------------------------------------------------- Wed Oct 15 09:28:36 UTC 2014 - thomas.blume@suse.com diff --git a/systemd-rpm-macros.spec b/systemd-rpm-macros.spec index c45cbf4..b8edade 100644 --- a/systemd-rpm-macros.spec +++ b/systemd-rpm-macros.spec @@ -29,8 +29,6 @@ Source0: macros.systemd Requires: coreutils BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildArch: noarch -# make systemd aware of changed unit file content after update -Patch0: systemd-daemon-reload-before-service-restart.patch %description Starting with openSUSE 12.1, several RPM macros must be used to package systemd @@ -38,7 +36,6 @@ services files. This package provides these macros. %prep cd %{_sourcedir} -%patch0 -p1 %build