OCaml 4.14.0 rebuild
[arch-packages.git] / systemd / repos / core-x86_64 / systemd-hook
blob0a4754b21647c645a14ab963da5da52d36e00fb8
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) /usr/bin/journalctl --update-catalog ;;
30 hwdb) /usr/bin/systemd-hwdb --usr update ;;
31 update) touch -c /usr ;;
32 sysusers) /usr/bin/systemd-sysusers ;;
33 tmpfiles) /usr/bin/systemd-tmpfiles --create ;;
35 daemon-reload) systemd_live; /usr/bin/systemctl daemon-reload ;;
36 udev-reload) udevd_live; /usr/bin/udevadm control --reload ;;
37 binfmt) systemd_live; /usr/lib/systemd/systemd-binfmt ;;
38 sysctl) systemd_live; /usr/lib/systemd/systemd-sysctl ;;
40 # For use by other packages
41 reload) systemd_live; /usr/bin/systemctl try-reload-or-restart "$@" ;;
43 *) echo >&2 " Invalid operation '$op'"; exit 1 ;;
44 esac
46 exit 0