Skip to content

Commit

Permalink
Add pacman hook to reload systemd services
Browse files Browse the repository at this point in the history
  • Loading branch information
seblu committed Feb 25, 2016
1 parent 3b8ad73 commit 38c3d8c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
12 changes: 12 additions & 0 deletions systemd-daemon-reload.hook
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 38c3d8c

Please sign in to comment.