systemd-hook 593 B

123456789101112131415161718192021222324
  1. #!/bin/sh -e
  2. systemd_live() {
  3. if [ ! -d /run/systemd/system ]; then
  4. echo >&2 " Skipped: Current root is not booted."
  5. exit 0
  6. fi
  7. }
  8. case $1 in
  9. catalog) /usr/bin/journalctl --update-catalog ;;
  10. update) touch -c /usr ;;
  11. sysusers) /usr/bin/systemd-sysusers ;;
  12. tmpfiles) /usr/bin/systemd-tmpfiles --create ;;
  13. daemon-reload) systemd_live; /usr/bin/systemctl daemon-reload ;;
  14. binfmt) systemd_live; /usr/lib/systemd/systemd-binfmt ;;
  15. sysctl) systemd_live; /usr/lib/systemd/systemd-sysctl ;;
  16. *) echo >&2 " Invalid operation '$1'"; exit 1 ;;
  17. esac
  18. exit 0