summaryrefslogtreecommitdiff
path: root/src/rpm
diff options
context:
space:
mode:
authorTomasz Paweł Gajc <tpgxyz@gmail.com>2022-05-27 16:15:01 +0200
committerTomasz Paweł Gajc <tpgxyz@gmail.com>2022-05-28 21:29:00 +0200
commit7bde8293a4f4ccfe4b5c5000869068e3c1ac45c6 (patch)
treed8c29f7e16b9a9da3b5591d40741890f8285a896 /src/rpm
parente1a8917ae162aefe8ad634464f798e9c87633ae0 (diff)
downloadsystemd-7bde8293a4f4ccfe4b5c5000869068e3c1ac45c6.tar.gz
rpm: use rpm.execute() instead of fork() and execp() for trigger scriplets
Diffstat (limited to 'src/rpm')
-rw-r--r--src/rpm/triggers.systemd.in37
1 files changed, 5 insertions, 32 deletions
diff --git a/src/rpm/triggers.systemd.in b/src/rpm/triggers.systemd.in
index 4755cdafe8..3d400c22c9 100644
--- a/src/rpm/triggers.systemd.in
+++ b/src/rpm/triggers.systemd.in
@@ -72,32 +72,17 @@ end
-- This script will process files installed in {{SYSUSERS_DIR}} to create
-- specified users automatically. The priority is set such that it
-- will run before the tmpfiles file trigger.
-pid = posix.fork()
-if pid == 0 then
- assert(posix.execp("systemd-sysusers"))
-elseif pid > 0 then
- posix.wait(pid)
-end
+assert(rpm.execute("systemd-sysusers"))
%transfiletriggerin -P 1000700 udev -p <lua> -- {{UDEV_HWDB_DIR}}
-- This script will automatically invoke hwdb update if files have been
-- installed or updated in {{UDEV_HWDB_DIR}}.
-pid = posix.fork()
-if pid == 0 then
- assert(posix.execp("systemd-hwdb", "update"))
-elseif pid > 0 then
- posix.wait(pid)
-end
+assert(rpm.execute("systemd-hwdb", "update"))
%transfiletriggerin -P 1000700 -p <lua> -- {{SYSTEMD_CATALOG_DIR}}
-- This script will automatically invoke journal catalog update if files
-- have been installed or updated in {{SYSTEMD_CATALOG_DIR}}.
-pid = posix.fork()
-if pid == 0 then
- assert(posix.execp("journalctl", "--update-catalog"))
-elseif pid > 0 then
- posix.wait(pid)
-end
+assert(rpm.execute("journalctl", "--update-catalog"))
%transfiletriggerin -P 1000700 -p <lua> -- {{BINFMT_DIR}}
-- This script will automatically apply binfmt rules if files have been
@@ -115,25 +100,13 @@ end
-- This script will process files installed in {{TMPFILES_DIR}} 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.execp("systemd-tmpfiles", "--create"))
- elseif pid > 0 then
- posix.wait(pid)
- end
-end
+assert(rpm.execute("systemd-tmpfiles", "--create"))
%transfiletriggerin -P 1000600 udev -p <lua> -- {{UDEV_RULES_DIR}}
-- This script will automatically update udev with new rules if files
-- have been installed or updated in {{UDEV_RULES_DIR}}.
if posix.access("/run/systemd/system") then
- pid = posix.fork()
- if pid == 0 then
- assert(posix.execp("udevadm", "control", "--reload"))
- elseif pid > 0 then
- posix.wait(pid)
- end
+ assert(rpm.execute("udevadm", "control", "--reload"))
end
%transfiletriggerin -P 1000500 -p <lua> -- {{SYSCTL_DIR}}