diff options
-rw-r--r-- | src/core/macros.systemd.in | 12 | ||||
-rw-r--r-- | src/core/triggers.systemd.in | 87 |
2 files changed, 90 insertions, 9 deletions
diff --git a/src/core/macros.systemd.in b/src/core/macros.systemd.in index cee9b89870..53b13a027e 100644 --- a/src/core/macros.systemd.in +++ b/src/core/macros.systemd.in @@ -84,17 +84,11 @@ fi \ %systemd_user_postun_with_restart() %{nil} -%udev_hwdb_update() \ -systemd-hwdb update >/dev/null 2>&1 || : \ -%{nil} +%udev_hwdb_update() %{nil} -%udev_rules_update() \ -udevadm control --reload >/dev/null 2>&1 || : \ -%{nil} +%udev_rules_update() %{nil} -%journal_catalog_update() \ -journalctl --update-catalog >/dev/null 2>&1 || : \ -%{nil} +%journal_catalog_update() %{nil} %tmpfiles_create() \ systemd-tmpfiles --create %{?*} >/dev/null 2>&1 || : \ diff --git a/src/core/triggers.systemd.in b/src/core/triggers.systemd.in index 985c6d8b26..c582d40977 100644 --- a/src/core/triggers.systemd.in +++ b/src/core/triggers.systemd.in @@ -4,6 +4,7 @@ # This file is part of systemd. # # Copyright 2015 Zbigniew Jędrzejewski-Szmek +# Copyright 2018 Neal Gompa # # 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 @@ -69,3 +70,89 @@ if posix.access("%{_localstatedir}/lib/rpm-state/systemd/needs-reload") then posix.wait(pid) end end + +%transfiletriggerin -P 100700 -p <lua> -- @sysusersdir@ +-- This script will process files installed in @sysusersdir@ to create +-- specified users automatically. The priority is set such that it +-- will run before the tmpfiles file trigger. +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("%{_bindir}/systemd-sysusers")) + elseif pid > 0 then + posix.wait(pid) + end +end + +%transfiletriggerin -P 100500 -- @tmpfilesdir@ +-- This script will process files installed in @tmpfilesdir@ to create +-- tmpfiles automatically. The priority is set such that it will run +-- after the sysusers file trigger, but before any other triggers. +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("%{_bindir}/systemd-tmpfiles", "--create")) + elseif pid > 0 then + posix.wait(pid) + end +end + +%transfiletriggerin -- @udevhwdbdir@ +-- This script will automatically invoke hwdb update if files have been +-- installed or updated in @udevhwdbdir@. +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("%{_bindir}/systemd-hwdb", "update")) + elseif pid > 0 then + posix.wait(pid) + end +end + +%transfiletriggerin -- @catalogdir@ +-- This script will automatically invoke journal catalog update if files +-- have been installed or updated in @catalogdir@. +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("%{_bindir}/journalctl", "--update-catalog")) + elseif pid > 0 then + posix.wait(pid) + end +end + +%transfiletriggerin -- @udevrulesdir@ +-- This script will automatically update udev with new rules if files +-- have been installed or updated in @udevrulesdir@. +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("%{_bindir}/udevadm", "control", "--reload")) + elseif pid > 0 then + posix.wait(pid) + end +end + +%transfiletriggerin -- @sysctldir@ +-- This script will automatically apply sysctl rules if files have been +-- installed or updated in @sysctldir@. +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("@rootlibexecdir@/systemd-sysctl")) + elseif pid > 0 then + posix.wait(pid) + end +end + +%transfiletriggerin -- @binfmtdir@ +-- This script will automatically apply binfmt rules if files have been +-- installed or updated in @binfmtdir@. +if posix.access("/run/systemd/system") then + pid = posix.fork() + if pid == 0 then + assert(posix.exec("@rootlibexecdir@/systemd-binfmt")) + elseif pid > 0 then + posix.wait(pid) + end +end |