From 38c3d8cba01af2dfbd7be4e9965a548994651260 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Luttringer?= Date: Thu, 25 Feb 2016 09:15:30 +0100 Subject: [PATCH] Add pacman hook to reload systemd services --- PKGBUILD | 4 +++- systemd-daemon-reload.hook | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 systemd-daemon-reload.hook diff --git a/PKGBUILD b/PKGBUILD index 4b7d67a..9f0f42f 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -14,7 +14,7 @@ conflicts=('archutils' 'kernel-reinstall') package() { cd "$startdir" - install -dm755 "$pkgdir"/usr/{share/licenses/$pkgname,bin,lib/munin/plugins} + install -dm755 "$pkgdir"/usr/{share/{licenses/$pkgname,libalpm/hooks},bin,lib/munin/plugins} # install legal stuff install -m644 COPYRIGHT LICENSE "$pkgdir/usr/share/licenses/$pkgname" # install binaries @@ -26,6 +26,8 @@ package() { # add shortcut, because i'm lazy ln -s checkservices "$pkgdir/usr/bin/cs" ln -s system-upgrade "$pkgdir/usr/bin/sup" + # add hooks + install -m644 systemd-daemon-reload.hook "$pkgdir/usr/share/libalpm/hooks/10-systemd-daemon-reload.hook" } # vim:set ts=2 sw=2 et: diff --git a/systemd-daemon-reload.hook b/systemd-daemon-reload.hook new file mode 100644 index 0000000..8e87fea --- /dev/null +++ b/systemd-daemon-reload.hook @@ -0,0 +1,12 @@ +[Trigger] +Operation = Install +Operation = Upgrade +Operation = Remove +Type = File +Target = *.service + +[Action] +Description = Reload of systemd units +Depends = systemd +When = PostTransaction +Exec = /usr/bin/systemctl daemon-reload -- GitLab