diff options
Diffstat (limited to 'systemd.install')
| -rw-r--r-- | systemd.install | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/systemd.install b/systemd.install index 9f01f18..33e9d0e 100644 --- a/systemd.install +++ b/systemd.install @@ -4,10 +4,11 @@ sd_booted() { [[ -d run/systemd/system && ! -L run/systemd/system ]] } -add_journal_acls() { - # ignore errors, since the filesystem might not support ACLs - setfacl -Rnm g:wheel:rx,d:g:wheel:rx,g:adm:rx,d:g:adm:rx var/log/journal/ 2>/dev/null - : +services_needing_restart() { + systemctl list-units --state=running --plain --quiet 'systemd-*.service' \ + | cut -d' ' -f1 \ + | grep -Ev '^systemd-(logind|networkd)\.service$' \ + | grep -Ev '^systemd-.*@.*\.service$' } post_common() { @@ -24,8 +25,6 @@ post_install() { post_common "$@" - add_journal_acls - # enable some services by default, but don't track them systemctl enable \ getty@tty1.service \ @@ -41,8 +40,25 @@ post_upgrade() { post_common "$@" if sd_booted; then + # reexec systemd system instance systemctl --system daemon-reexec - systemctl kill --kill-whom='main' --signal='SIGRTMIN+25' 'user@*.service' + + # reexec systemd user instances + systemctl reload 'user@*.service' + + # mark systemd services for later restart + for UNIT in $(services_needing_restart); do + systemctl set-property --runtime "${UNIT}" Markers=needs-restart + done + fi + + # show for feature release: 255 -> 256 -> 257 -> ... + if [ $(vercmp "${1%%[!0-9]*}" "${2%%[!0-9]*}") -ne 0 ]; then + cat <<-EOM + :: This is a systemd feature update. You may want to have a look at + NEWS for what changed, or if you observe unexpected behavior: + /usr/share/doc/systemd/NEWS + EOM fi local v upgrades=( |
