diff options
Diffstat (limited to 'src/rpm/triggers.systemd.in')
-rw-r--r-- | src/rpm/triggers.systemd.in | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/src/rpm/triggers.systemd.in b/src/rpm/triggers.systemd.in index 247358008a..d29cc33dfd 100644 --- a/src/rpm/triggers.systemd.in +++ b/src/rpm/triggers.systemd.in @@ -13,20 +13,11 @@ -- upgraded. We care about the case where a package is initially -- installed, because other cases are covered by the *un scriptlets, -- so sometimes we will reload needlessly. -if posix.access("/run/systemd/system") then - pid = posix.fork() - if pid == 0 then - assert(posix.execp("systemctl", "daemon-reload")) - elseif pid > 0 then - posix.wait(pid) - end - - pid = posix.fork() - if pid == 0 then - assert(posix.execp("systemctl", "reload-or-restart", "--marked")) - elseif pid > 0 then - posix.wait(pid) - end +pid = posix.fork() +if pid == 0 then + assert(posix.exec("{{SYSTEMD_UPDATE_HELPER_PATH}}", "system-reload-restart")) +elseif pid > 0 then + posix.wait(pid) end %transfiletriggerpostun -P 1000100 -p <lua> -- {{SYSTEM_DATA_UNIT_DIR}} /etc/systemd/system @@ -35,24 +26,20 @@ end -- On upgrade, we need to run daemon-reload after any new unit files -- have been installed, but before %postun scripts in packages get -- executed. -if posix.access("/run/systemd/system") then - pid = posix.fork() - if pid == 0 then - assert(posix.execp("systemctl", "daemon-reload")) - elseif pid > 0 then - posix.wait(pid) - end +pid = posix.fork() +if pid == 0 then + assert(posix.exec("{{SYSTEMD_UPDATE_HELPER_PATH}}", "system-reload")) +elseif pid > 0 then + posix.wait(pid) end %transfiletriggerpostun -P 10000 -p <lua> -- {{SYSTEM_DATA_UNIT_DIR}} /etc/systemd/system -- We restart remaining services that should be restarted here. -if posix.access("/run/systemd/system") then - pid = posix.fork() - if pid == 0 then - assert(posix.execp("systemctl", "reload-or-restart", "--marked")) - elseif pid > 0 then - posix.wait(pid) - end +pid = posix.fork() +if pid == 0 then + assert(posix.exec("{{SYSTEMD_UPDATE_HELPER_PATH}}", "system-restart")) +elseif pid > 0 then + posix.wait(pid) end %transfiletriggerin -P 100700 -p <lua> -- {{SYSUSERS_DIR}} |