From 873e413323dfff4023604849c70944674ae5cd29 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sat, 14 Nov 2015 19:14:34 -0500 Subject: Move daemon-reload from package %post scripts to file triggers This uses new functionality added in rpm 4.13. Instead of doing one daemon-reload per packages, we do just one or two (When both installing and uninstalling packages, we do two. Unfortunately this also includes the common case of upgrades. When only installing or when only installing, we do just one.) New file triggers.systemd can be built, but the contents have to be copied into the rpm spec file by hand. Using %{load} does not seem to work. It can serve as documentation. --- src/core/triggers.systemd.in | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/core/triggers.systemd.in (limited to 'src/core/triggers.systemd.in') diff --git a/src/core/triggers.systemd.in b/src/core/triggers.systemd.in new file mode 100644 index 0000000000..141f42dbcf --- /dev/null +++ b/src/core/triggers.systemd.in @@ -0,0 +1,26 @@ +# -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */ +# +# This file is part of systemd. +# +# Copyright 2015 Zbigniew Jędrzejewski-Szmek +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. +# +# systemd is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with systemd; If not, see . + +# The contents of this are an example to be copied into systemd.spec. + +%transfiletriggerin -- @systemunitdir@ /etc/systemd/system +systemctl daemon-reload &>/dev/null || : + +%transfiletriggerun -- @systemunitdir@ /etc/systemd/system +systemctl daemon-reload &>/dev/null || : -- cgit v1.2.3-54-g00ecf