diff --git a/macros.systemd b/macros.systemd index 9cb4392..802380d 100644 --- a/macros.systemd +++ b/macros.systemd @@ -32,10 +32,11 @@ Requires(postun): systemd \ %service_add_pre() \ test -n "$FIRST_ARG" || FIRST_ARG=$1 \ # disable migration if initial install under systemd \ +[ -d /var/lib/systemd/migrated ] || mkdir -p /var/lib/systemd/migrated || : \ if [ $FIRST_ARG -eq 1 ]; then \ for service in %{?*} ; do \ sysv_service=${service%.*} \ - touch "/var/lib/systemd/migrated/$sysv_service" \ + touch "/var/lib/systemd/migrated/$sysv_service" || : \ done \ else \ for service in %{?*} ; do \ @@ -53,11 +54,12 @@ fi \ # On install, tell systemd to reload its unit files %service_add_post() \ test -n "$FIRST_ARG" || FIRST_ARG=$1 \ +[ -d /var/lib/systemd/migrated ] || mkdir -p /var/lib/systemd/migrated || : \ for service in %{?*} ; do \ sysv_service=${service%.*} \ if [ ! -e "/var/lib/systemd/migrated/$sysv_service" ]; then \ services_to_migrate="$services_to_migrate $sysv_service" \ - touch "/var/lib/systemd/migrated/$sysv_service" \ + touch "/var/lib/systemd/migrated/$sysv_service" || : \ fi \ done \ /bin/systemctl daemon-reload >/dev/null 2>&1 || : \ @@ -87,7 +89,7 @@ if [ $FIRST_ARG -ge 1 ]; then \ else # package uninstall \ for service in %{?*} ; do \ sysv_service=${service%.*} \ - rm -f "/var/lib/systemd/migrated/$sysv_service" 2> /dev/null \ + rm -f "/var/lib/systemd/migrated/$sysv_service" 2> /dev/null || : \ done \ /bin/systemctl daemon-reload >/dev/null 2>&1 || : \ fi \ diff --git a/systemd.changes b/systemd.changes index 2ed4bd0..4cff8ff 100644 --- a/systemd.changes +++ b/systemd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Jul 30 11:37:17 UTC 2012 - fcrozat@suse.com + +- Ensure systemd macros never fails (if systemd isn't install) + ------------------------------------------------------------------- Mon Jul 23 08:28:15 UTC 2012 - fcrozat@suse.com