| 1 |
# -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */ |
| 2 |
# SPDX-License-Identifier: LGPL-2.1-or-later |
| 3 |
# |
| 4 |
# This file is part of systemd. |
| 5 |
# Copyright © 2018 Neal Gompa |
| 6 |
|
| 7 |
# The contents of this are an example to be copied into systemd.spec. |
| 8 |
# |
| 9 |
# Minimum rpm version supported: 4.14.0 |
| 10 |
|
| 11 |
%transfiletriggerin -P 900900 -p <lua> -- {{SYSTEM_DATA_UNIT_DIR}}/ /etc/systemd/system/ |
| 12 |
-- This script will run after any package is initially installed or |
| 13 |
-- upgraded. We care about the case where a package is initially |
| 14 |
-- installed, because other cases are covered by the *un scriptlets, |
| 15 |
-- so sometimes we will reload needlessly. |
| 16 |
assert(rpm.execute("{{SYSTEMD_UPDATE_HELPER_PATH}}", "system-reload-restart")) |
| 17 |
|
| 18 |
%transfiletriggerin -P 900899 -p <lua> -- {{USER_DATA_UNIT_DIR}}/ /etc/systemd/user/ |
| 19 |
assert(rpm.execute("{{SYSTEMD_UPDATE_HELPER_PATH}}", "user-reload-restart")) |
| 20 |
|
| 21 |
%transfiletriggerpostun -P 1000100 -p <lua> -- {{SYSTEM_DATA_UNIT_DIR}}/ /etc/systemd/system/ |
| 22 |
-- On removal, we need to run daemon-reload after any units have been |
| 23 |
-- removed. |
| 24 |
-- On upgrade, we need to run daemon-reload after any new unit files |
| 25 |
-- have been installed, but before %postun scripts in packages get |
| 26 |
-- executed. |
| 27 |
assert(rpm.execute("{{SYSTEMD_UPDATE_HELPER_PATH}}", "system-reload")) |
| 28 |
|
| 29 |
%transfiletriggerpostun -P 1000100 -p <lua> -- {{SYSTEM_DATA_UNIT_DIR}}/ /etc/systemd/system/ |
| 30 |
-- Execute daemon-reload in user managers. |
| 31 |
assert(rpm.execute("{{SYSTEMD_UPDATE_HELPER_PATH}}", "user-reload")) |
| 32 |
|
| 33 |
%transfiletriggerpostun -P 10000 -p <lua> -- {{SYSTEM_DATA_UNIT_DIR}}/ /etc/systemd/system/ |
| 34 |
-- We restart remaining system services that should be restarted here. |
| 35 |
assert(rpm.execute("{{SYSTEMD_UPDATE_HELPER_PATH}}", "system-restart")) |
| 36 |
|
| 37 |
%transfiletriggerpostun -P 9999 -p <lua> -- {{USER_DATA_UNIT_DIR}}/ /etc/systemd/user/ |
| 38 |
-- We restart remaining user services that should be restarted here. |
| 39 |
assert(rpm.execute("{{SYSTEMD_UPDATE_HELPER_PATH}}", "user-restart")) |
| 40 |
|
| 41 |
%transfiletriggerin -P 1000700 -p <lua> -- {{SYSUSERS_DIR}}/ |
| 42 |
-- This script will process files installed in {{SYSUSERS_DIR}} to create |
| 43 |
-- specified users automatically. The priority is set such that it |
| 44 |
-- will run before the tmpfiles file trigger. |
| 45 |
assert(rpm.execute("systemd-sysusers")) |
| 46 |
|
| 47 |
%transfiletriggerin -P 1000700 udev -p <lua> -- {{UDEV_HWDB_DIR}}/ |
| 48 |
-- This script will automatically invoke hwdb update if files have been |
| 49 |
-- installed or updated in {{UDEV_HWDB_DIR}}. |
| 50 |
assert(rpm.execute("systemd-hwdb", "update")) |
| 51 |
|
| 52 |
%transfiletriggerin -P 1000700 -p <lua> -- {{SYSTEMD_CATALOG_DIR}}/ |
| 53 |
-- This script will automatically invoke journal catalog update if files |
| 54 |
-- have been installed or updated in {{SYSTEMD_CATALOG_DIR}}. |
| 55 |
assert(rpm.execute("journalctl", "--update-catalog")) |
| 56 |
|
| 57 |
%transfiletriggerin -P 1000700 -p <lua> -- {{BINFMT_DIR}}/ |
| 58 |
-- This script will automatically apply binfmt rules if files have been |
| 59 |
-- installed or updated in {{BINFMT_DIR}}. |
| 60 |
if posix.access("/run/systemd/system") then |
| 61 |
assert(rpm.execute("{{LIBEXECDIR}}/systemd-binfmt")) |
| 62 |
end |
| 63 |
|
| 64 |
%transfiletriggerin -P 1000600 -p <lua> -- {{TMPFILES_DIR}}/ |
| 65 |
-- This script will process files installed in {{TMPFILES_DIR}} to create |
| 66 |
-- tmpfiles automatically. The priority is set such that it will run |
| 67 |
-- after the sysusers file trigger, but before any other triggers. |
| 68 |
assert(rpm.execute("systemd-tmpfiles", "--create")) |
| 69 |
|
| 70 |
%transfiletriggerin -P 1000600 udev -p <lua> -- {{UDEV_RULES_DIR}}/ |
| 71 |
-- This script will automatically update udev with new rules if files |
| 72 |
-- have been installed or updated in {{UDEV_RULES_DIR}}. |
| 73 |
assert(rpm.execute("{{SYSTEMD_UPDATE_HELPER_PATH}}", "mark-reload-system-units", "systemd-udevd.service")) |
| 74 |
|
| 75 |
%transfiletriggerin -P 1000500 -p <lua> -- {{SYSCTL_DIR}}/ |
| 76 |
-- This script will automatically apply sysctl rules if files have been |
| 77 |
-- installed or updated in {{SYSCTL_DIR}}. |
| 78 |
if posix.access("/run/systemd/system") then |
| 79 |
assert(rpm.execute("{{LIBEXECDIR}}/systemd-sysctl")) |
| 80 |
end |