systemd-hook 724 B

1234567891011121314151617181920212223242526272829
  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. op="$1"; shift
  9. case "$op" in
  10. catalog) /usr/bin/journalctl --update-catalog ;;
  11. update) touch -c /usr ;;
  12. sysusers) /usr/bin/systemd-sysusers ;;
  13. tmpfiles) /usr/bin/systemd-tmpfiles --create ;;
  14. daemon-reload) systemd_live; /usr/bin/systemctl daemon-reload ;;
  15. binfmt) systemd_live; /usr/lib/systemd/systemd-binfmt ;;
  16. sysctl) systemd_live; /usr/lib/systemd/systemd-sysctl ;;
  17. # For use by other packages
  18. reload) systemd_live; /usr/bin/systemctl try-reload-or-restart "$@" ;;
  19. *) echo >&2 " Invalid operation '$op'"; exit 1 ;;
  20. esac
  21. exit 0