]> git.pld-linux.org Git - packages/rpm-build-macros.git/commitdiff
pass RPM_SKIP_AUTO_RESTART value of a service to %systemd_post
authorTomasz Pala <gotar@pld-linux.org>
Wed, 24 Aug 2016 13:18:21 +0000 (15:18 +0200)
committerTomasz Pala <gotar@pld-linux.org>
Wed, 24 Aug 2016 13:18:21 +0000 (15:18 +0200)
rpm.macros
service_generator.sh

index 7edf4cf144ecc98e8e0d54df330d5049e4b2c678..c7d7db35032917410fa330990f150f8adfabadd2 100644 (file)
@@ -1434,6 +1434,9 @@ fi \
 # calls usual service restart on package %post, but skips the restart if
 # administrator has disabled automatic service restarts in either global
 # /etc/sysconfig/rpm or per service /etc/sysconfig/SERVICE file.
+# NOTE: systemd_booted machines do not print
+#              Run "{command}" to restart {service}.
+# message for packages without native systemd unit (not here, no %systemd_post).
 #
 # Usage:
 #   %service [-q] [-n] SERVICE ACTION ["SERVICE NICE DESCRIPTION"]
@@ -2217,13 +2220,13 @@ fi; \
        /bin/systemd_booted && /bin/systemctl --quiet stop %{*} || : \
 %{nil}
 
-# doesn't honour RPM_SKIP_AUTO_RESTART, avoid using
+# NOTE: doesn't honour RPM_SKIP_AUTO_RESTART, avoid using
 %systemd_service_restart() \
        export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
        /bin/systemd_booted && /bin/systemctl --quiet try-restart %{*} || : \
 %{nil}
 
-# doesn't honour RPM_SKIP_AUTO_RESTART, avoid using
+# NOTE: doesn't honour RPM_SKIP_AUTO_RESTART, avoid using
 %systemd_service_reload() \
        export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
        /bin/systemd_booted && /bin/systemctl --quiet reload %{*} || : \
@@ -2245,7 +2248,6 @@ want_enable_service() { \
        done \
 %{nil}
 
-# TODO: resurrect RPM_SKIP_AUTO_RESTART by using $(skip_auto_restart) function defined by %service from service_generator.sh
 %systemd_post() \
        export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
        /bin/systemd_booted && /bin/systemctl --quiet daemon-reload || : \
index 39551a8f0780cf787771da521d7063f49e20566f..7fa360b9120937a9bdc21764855b6bcc5a4f5bc8 100755 (executable)
@@ -65,6 +65,7 @@ if [ "$check" = 1 ]; then
                        if [ -f /var/lock/subsys/$service ]; then
                                echo 'Run "/sbin/service $service restart" to restart $desc.'
                        fi
+               else    NORESTART=1     # for %systemd_post if called after
                fi
        EOF
        echo 'fi'
This page took 0.075565 seconds and 4 git commands to generate.