|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
# -*- Mode: rpm-spec; indent-tabs-mode: nil -*- */
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
#
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
# This file is part of systemd.
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
#
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
# Copyright 2015 Zbigniew Jędrzejewski-Szmek
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
#
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
#
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
# Lesser General Public License for more details.
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
#
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
# along with systemd; If not, see <http://www.gnu.org/licenses/>.
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
%transfiletriggerin -P 900900 -p <lua> -- /usr/lib/systemd/system /etc/systemd/system
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
-- This script will run after any package is initially installed or
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
pid = posix.fork()
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
if pid == 0 then
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
assert(posix.exec("%{_bindir}/systemctl", "daemon-reload"))
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
elseif pid > 0 then
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
posix.wait(pid)
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
end
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
%transfiletriggerun -p <lua> -- /usr/lib/systemd/system /etc/systemd/system
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
-- On removal, we need to run daemon-reload after any units have been
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
-- executed for some reason.
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
-- On upgrade, we need to run daemon-reload after any new unit files
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
-- every package.
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
-- file in %transfiletriggerun and execute the daemon-reload in
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
posix.mkdir("%{_localstatedir}/lib")
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
posix.mkdir("%{_localstatedir}/lib/rpm-state")
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
posix.mkdir("%{_localstatedir}/lib/rpm-state/systemd")
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
io.open("%{_localstatedir}/lib/rpm-state/systemd/needs-reload", "w")
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
%filetriggerpostun -P 1000100 -p <lua> -- /usr/lib/systemd/system /etc/systemd/system
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
if posix.access("%{_localstatedir}/lib/rpm-state/systemd/needs-reload") then
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
posix.unlink("%{_localstatedir}/lib/rpm-state/systemd/needs-reload")
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
posix.rmdir("%{_localstatedir}/lib/rpm-state/systemd")
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
pid = posix.fork()
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
if pid == 0 then
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
assert(posix.exec("%{_bindir}/systemctl", "daemon-reload"))
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
elseif pid > 0 then
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
posix.wait(pid)
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
end
|
|
Zbigniew Jędrzejewski-Szmek |
8b4408 |
end
|