]> git.pld-linux.org Git - packages/rpm-build-macros.git/commitdiff
- use systemd_booted to check if system is booted using systemd auto/th/rpm-build-macros-1_625-1
authorArtur Frysiak <artur@frysiak.net>
Sun, 4 Dec 2011 13:26:25 +0000 (13:26 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- redirect message from systemctl to syslog

Changed files:
    rpm-build-macros.spec -> 1.305
    rpm.macros -> 1.625

rpm-build-macros.spec
rpm.macros

index 211aaddb62a0a96717c06ef0c94700552f9534cb..558219c53640a01fbda250027f1ad7ea5d54c94b 100644 (file)
@@ -1,4 +1,4 @@
-%define                rpm_macros_rev  1.624
+%define                rpm_macros_rev  1.625
 %define                find_lang_rev   1.35
 Summary:       PLD Linux RPM build macros
 Summary(pl.UTF-8):     Makra do budowania pakietów RPM dla Linuksa PLD
index 43b8a094d4731c1dfd6584770598af879a56a80c..d41f57b696487a62410fc098924d1f9e5b9a5c8f 100644 (file)
@@ -2065,29 +2065,37 @@ else: \
 # %systemd_postun %{name}
 #
 # Requirements:
-# BuildRequires: rpmbuild(macros) >= 1.622
-# Requires:     rc-scripts >= ...
+# BuildRequires: rpmbuild(macros) >= 1.625
+# Requires:     systemd-units >= 37-0.10
 
 %systemd_enable() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog; \
        if [ $1 -eq 1 ]; then  \
-               /bin/systemctl enable %1 >/dev/null 2>&1 || : \
+               /bin/systemctl --quiet enable %1 || : \
        fi
 
 %systemd_post() \
-       if [ $1 -eq 1 ]; then \
-               /bin/systemctl daemon-reload >/dev/null 2>&1 || : \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog; \
+       if [ $1 -eq 1 ] && /bin/systemd_booted; then \
+               /bin/systemctl --quiet daemon-reload || : \
        fi
 
 %systemd_preun() \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog; \
        if [ $1 -eq 0 ]; then \
-               /bin/systemctl --no-reload disable %1 > /dev/null 2>&1 || : \
-               /bin/systemctl stop %1 > /dev/null 2>&1 || : \
+               /bin/systemctl --no-reload --quiet disable %1 || : \
+               if /bin/systemd_booted; then \
+                       /bin/systemctl --quiet stop %1 || : \
+               fi \
        fi
 
 %systemd_postun() \
-    /bin/systemctl daemon-reload >/dev/null 2>&1 || : \
-    if [ $1 -ge 1 ]; then \
-               /bin/systemctl try-restart %1 >/dev/null 2>&1 || : \
+       export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog; \
+       if /bin/systemd_booted; then \
+               /bin/systemctl --quiet daemon-reload || : \
+               if [ $1 -ge 1 ]; then \
+                       /bin/systemctl --quiet try-restart %1 || : \
+               fi \
        fi
 
 %systemdunitdir /lib/systemd/system
This page took 0.057739 seconds and 4 git commands to generate.