diff options
author | Omar Vega Ramos <ovruni@gnu.org.pe> | 2018-03-13 03:41:24 -0500 |
---|---|---|
committer | Omar Vega Ramos <ovruni@gnu.org.pe> | 2018-03-13 03:41:24 -0500 |
commit | adb1d0db1ac5a7eb1e6480a49e1981cddb431017 (patch) | |
tree | 7648cc8dd9fd9b59de6b02787b49bf8568663aab /libre/systemd/systemd-hook | |
parent | 5fed6ef4ba36f621ad6ff0ab01a32e718641a4f2 (diff) | |
download | abslibre-adb1d0db1ac5a7eb1e6480a49e1981cddb431017.tar.gz abslibre-adb1d0db1ac5a7eb1e6480a49e1981cddb431017.tar.bz2 abslibre-adb1d0db1ac5a7eb1e6480a49e1981cddb431017.zip |
systemd-238.0-3.parabola1: updating version
Diffstat (limited to 'libre/systemd/systemd-hook')
-rw-r--r-- | libre/systemd/systemd-hook | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/libre/systemd/systemd-hook b/libre/systemd/systemd-hook new file mode 100644 index 000000000..c52e71533 --- /dev/null +++ b/libre/systemd/systemd-hook @@ -0,0 +1,38 @@ +#!/bin/sh -e + +systemd_live() { + if [ ! -d /run/systemd/system ]; then + echo >&2 " Skipped: Current root is not booted." + exit 0 + fi +} + +udevd_live() { + if [ ! -d /run/udev ]; then + echo >&2 " Skipped: Device manager is not running." + exit 0 + fi +} + +each_conf() { + while read -r f; do + "$@" "$(basename "$f")" + done +} + +case $1 in + catalog) /usr/bin/journalctl --update-catalog ;; + hwdb) /usr/bin/systemd-hwdb --usr update ;; + update) touch -c /usr ;; + sysusers) each_conf /usr/bin/systemd-sysusers ;; + tmpfiles) each_conf /usr/bin/systemd-tmpfiles --create ;; + + daemon-reload) systemd_live; /usr/bin/systemctl daemon-reload ;; + udev-reload) systemd_live; /usr/bin/udevadm control --reload ;; + binfmt) systemd_live; each_conf /usr/lib/systemd/systemd-binfmt ;; + sysctl) systemd_live; each_conf /usr/lib/systemd/systemd-sysctl ;; + + *) echo >&2 " Invalid operation '$1'"; exit 1 ;; +esac + +exit 0 |