archrelease: copy trunk to extra-x86_64
[arch-packages.git] / systemd / repos / core-x86_64 / systemd-hook
blob4a62ec6c48dfb1787f3345e9ca19ccbf3e609c16
1 #!/bin/sh -e
3 is_chrooted() {
4 if systemd-detect-virt --chroot; then
5 echo >&2 " Skipped: Running in chroot."
6 exit 0
7 fi
10 systemd_live() {
11 is_chrooted
12 if [ ! -d /run/systemd/system ]; then
13 echo >&2 " Skipped: Current root is not booted."
14 exit 0
18 udevd_live() {
19 is_chrooted
20 if [ ! -d /run/udev ]; then
21 echo >&2 " Skipped: Device manager is not running."
22 exit 0
26 op="$1"; shift
28 case "$op" in
29 catalog)
30 /usr/bin/journalctl --update-catalog
32 hwdb)
33 /usr/bin/systemd-hwdb --usr update
35 update)
36 touch -c /usr
38 sysusers)
39 /usr/bin/systemd-sysusers
41 tmpfiles)
42 /usr/bin/systemd-tmpfiles --create
45 daemon-reload)
46 systemd_live
47 /usr/bin/systemctl daemon-reload
49 udev-reload)
50 udevd_live
51 /usr/bin/udevadm control --reload
52 /usr/bin/udevadm trigger
53 /usr/bin/udevadm settle
55 binfmt)
56 systemd_live
57 /usr/lib/systemd/systemd-binfmt
59 sysctl)
60 systemd_live
61 /usr/lib/systemd/systemd-sysctl
64 # For use by other packages
65 reload)
66 systemd_live
67 /usr/bin/systemctl try-reload-or-restart "$@"
71 echo >&2 " Invalid operation '$op'"
72 exit 1
74 esac
76 exit 0