|
4 | 4 | # This file is part of systemd. |
5 | 5 | # |
6 | 6 | # Copyright 2015 Zbigniew Jędrzejewski-Szmek |
| 7 | +# Copyright 2018 Neal Gompa |
7 | 8 | # |
8 | 9 | # systemd is free software; you can redistribute it and/or modify it |
9 | 10 | # 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 |
69 | 70 | posix.wait(pid) |
70 | 71 | end |
71 | 72 | end |
| 73 | + |
| 74 | +%transfiletriggerin -P 100700 -p <lua> -- @sysusersdir@ |
| 75 | +-- This script will process files installed in @sysusersdir@ to create |
| 76 | +-- specified users automatically. The priority is set such that it |
| 77 | +-- will run before the tmpfiles file trigger. |
| 78 | +if posix.access("/run/systemd/system") then |
| 79 | + pid = posix.fork() |
| 80 | + if pid == 0 then |
| 81 | + assert(posix.exec("%{_bindir}/systemd-sysusers")) |
| 82 | + elseif pid > 0 then |
| 83 | + posix.wait(pid) |
| 84 | + end |
| 85 | +end |
| 86 | + |
| 87 | +%transfiletriggerin -P 100500 -- @tmpfilesdir@ |
| 88 | +-- This script will process files installed in @tmpfilesdir@ to create |
| 89 | +-- tmpfiles automatically. The priority is set such that it will run |
| 90 | +-- after the sysusers file trigger, but before any other triggers. |
| 91 | +if posix.access("/run/systemd/system") then |
| 92 | + pid = posix.fork() |
| 93 | + if pid == 0 then |
| 94 | + assert(posix.exec("%{_bindir}/systemd-tmpfiles", "--create")) |
| 95 | + elseif pid > 0 then |
| 96 | + posix.wait(pid) |
| 97 | + end |
| 98 | +end |
| 99 | + |
| 100 | +%transfiletriggerin -- @udevhwdbdir@ |
| 101 | +-- This script will automatically invoke hwdb update if files have been |
| 102 | +-- installed or updated in @udevhwdbdir@. |
| 103 | +if posix.access("/run/systemd/system") then |
| 104 | + pid = posix.fork() |
| 105 | + if pid == 0 then |
| 106 | + assert(posix.exec("%{_bindir}/systemd-hwdb", "update")) |
| 107 | + elseif pid > 0 then |
| 108 | + posix.wait(pid) |
| 109 | + end |
| 110 | +end |
| 111 | + |
| 112 | +%transfiletriggerin -- @catalogdir@ |
| 113 | +-- This script will automatically invoke journal catalog update if files |
| 114 | +-- have been installed or updated in @catalogdir@. |
| 115 | +if posix.access("/run/systemd/system") then |
| 116 | + pid = posix.fork() |
| 117 | + if pid == 0 then |
| 118 | + assert(posix.exec("%{_bindir}/journalctl", "--update-catalog")) |
| 119 | + elseif pid > 0 then |
| 120 | + posix.wait(pid) |
| 121 | + end |
| 122 | +end |
| 123 | + |
| 124 | +%transfiletriggerin -- @udevrulesdir@ |
| 125 | +-- This script will automatically update udev with new rules if files |
| 126 | +-- have been installed or updated in @udevrulesdir@. |
| 127 | +if posix.access("/run/systemd/system") then |
| 128 | + pid = posix.fork() |
| 129 | + if pid == 0 then |
| 130 | + assert(posix.exec("%{_bindir}/udevadm", "control", "--reload")) |
| 131 | + elseif pid > 0 then |
| 132 | + posix.wait(pid) |
| 133 | + end |
| 134 | +end |
| 135 | + |
| 136 | +%transfiletriggerin -- @sysctldir@ |
| 137 | +-- This script will automatically apply sysctl rules if files have been |
| 138 | +-- installed or updated in @sysctldir@. |
| 139 | +if posix.access("/run/systemd/system") then |
| 140 | + pid = posix.fork() |
| 141 | + if pid == 0 then |
| 142 | + assert(posix.exec("@rootlibexecdir@/systemd-sysctl")) |
| 143 | + elseif pid > 0 then |
| 144 | + posix.wait(pid) |
| 145 | + end |
| 146 | +end |
| 147 | + |
| 148 | +%transfiletriggerin -- @binfmtdir@ |
| 149 | +-- This script will automatically apply binfmt rules if files have been |
| 150 | +-- installed or updated in @binfmtdir@. |
| 151 | +if posix.access("/run/systemd/system") then |
| 152 | + pid = posix.fork() |
| 153 | + if pid == 0 then |
| 154 | + assert(posix.exec("@rootlibexecdir@/systemd-binfmt")) |
| 155 | + elseif pid > 0 then |
| 156 | + posix.wait(pid) |
| 157 | + end |
| 158 | +end |
0 commit comments