Debian Codegraph @

src/rpm/triggers.systemd.sh.in

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