summaryrefslogtreecommitdiff
path: root/libre/notsystemd/systemd-hook
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2018-07-21 17:27:13 -0400
committerLuke Shumaker <lukeshu@lukeshu.com>2018-07-24 00:58:10 -0400
commit5cda8090484becc96da80c15f1db5b8c137a79b9 (patch)
tree633acd19dd3ac32e1f5a58285af2788a070fe0e4 /libre/notsystemd/systemd-hook
parentb24f38ea39ad553c4cc428b189687ac6eccf1cfa (diff)
downloadabslibre-5cda8090484becc96da80c15f1db5b8c137a79b9.tar.gz
abslibre-5cda8090484becc96da80c15f1db5b8c137a79b9.tar.bz2
abslibre-5cda8090484becc96da80c15f1db5b8c137a79b9.zip
libre/notsystemd: Update to 239.1
Diffstat (limited to 'libre/notsystemd/systemd-hook')
-rw-r--r--libre/notsystemd/systemd-hook23
1 files changed, 23 insertions, 0 deletions
diff --git a/libre/notsystemd/systemd-hook b/libre/notsystemd/systemd-hook
new file mode 100644
index 000000000..793a42943
--- /dev/null
+++ b/libre/notsystemd/systemd-hook
@@ -0,0 +1,23 @@
+#!/bin/sh -e
+
+systemd_live() {
+ if [ ! -d /run/systemd/system ]; then
+ echo >&2 " Skipped: Current root is not booted."
+ exit 0
+ fi
+}
+
+case $1 in
+ catalog) /usr/bin/journalctl --update-catalog ;;
+ update) touch -c /usr ;;
+ sysusers) /usr/bin/systemd-sysusers ;;
+ tmpfiles) /usr/bin/systemd-tmpfiles --create ;;
+
+ daemon-reload) systemd_live; /usr/bin/systemctl daemon-reload ;;
+ binfmt) systemd_live; /usr/lib/systemd/systemd-binfmt ;;
+ sysctl) systemd_live; /usr/lib/systemd/systemd-sysctl ;;
+
+ *) echo >&2 " Invalid operation '$1'"; exit 1 ;;
+esac
+
+exit 0