PKGBUILDs/core/systemd/systemd.install

75 lines
1.8 KiB
Plaintext
Raw Permalink Normal View History

2014-07-16 02:33:04 +00:00
#!/bin/bash
sd_booted() {
2014-08-27 06:22:24 +00:00
[[ -d run/systemd/system && ! -L run/systemd/system ]]
2014-07-16 02:33:04 +00:00
}
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
:
}
post_common() {
2014-08-27 06:22:24 +00:00
systemd-sysusers
2014-07-16 02:33:04 +00:00
journalctl --update-catalog
2024-06-18 12:51:14 +00:00
if ! grep -qe '^/usr/bin/systemd-home-fallback-shell$' etc/shells; then
echo '/usr/bin/systemd-home-fallback-shell' >> etc/shells
fi
2014-07-16 02:33:04 +00:00
}
post_install() {
2015-02-17 04:46:29 +00:00
systemd-machine-id-setup
2014-08-27 06:22:24 +00:00
2014-07-16 02:33:04 +00:00
post_common "$@"
add_journal_acls
2015-04-19 14:43:25 +00:00
# enable some services by default, but don't track them
2021-05-10 22:59:02 +00:00
systemctl enable \
getty@tty1.service \
2024-01-09 19:40:16 +00:00
remote-fs.target \
systemd-userdbd.socket
2014-07-16 02:33:04 +00:00
echo ":: Append 'init=/usr/lib/systemd/systemd' to your kernel command line in your"
echo " bootloader to replace sysvinit with systemd, or install systemd-sysvcompat"
2015-04-19 14:43:25 +00:00
# group 'systemd-journal-remote' is created by systemd-sysusers
mkdir -m2755 var/log/journal/remote
chgrp systemd-journal-remote var/log/journal/remote
2014-07-16 02:33:04 +00:00
}
post_upgrade() {
post_common "$@"
2021-07-12 18:21:56 +00:00
if sd_booted; then
systemctl --system daemon-reexec
2023-12-07 19:09:41 +00:00
systemctl kill --kill-whom='main' --signal='SIGRTMIN+25' 'user@*.service'
2021-07-12 18:21:56 +00:00
fi
2024-06-18 12:51:14 +00:00
# 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
2016-07-20 13:31:52 +00:00
local v upgrades=(
)
2014-07-16 02:33:04 +00:00
for v in "${upgrades[@]}"; do
if [[ $(vercmp "$v" "$2") -eq 1 ]]; then
2017-07-06 12:27:58 +00:00
"_${v//[.-]/_}_changes"
2014-07-16 02:33:04 +00:00
fi
done
}
2024-06-18 12:51:14 +00:00
post_remove() {
sed -i -r '/^\/usr\/bin\/systemd-home-fallback-shell$/d' etc/shells
}
2014-07-16 02:33:04 +00:00
# vim:set ts=2 sw=2 et: