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
|
|
|
|
}
|
|
|
|
|
2019-04-26 12:43:17 +00:00
|
|
|
_242_0_2_changes() {
|
|
|
|
if [[ -L var/lib/systemd/timesync ]]; then
|
|
|
|
rm var/lib/systemd/timesync
|
|
|
|
if [[ -d var/lib/private/systemd/timesync ]]; then
|
|
|
|
mv var/lib/{private/,}systemd/timesync
|
|
|
|
fi
|
|
|
|
fi
|
2019-04-23 23:53:51 +00:00
|
|
|
}
|
|
|
|
|
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 \
|
|
|
|
remote-fs.target
|
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
|
|
|
|
fi
|
|
|
|
|
2016-07-20 13:31:52 +00:00
|
|
|
local v upgrades=(
|
2019-04-26 12:43:17 +00:00
|
|
|
242.0-2
|
2016-07-20 13:31:52 +00:00
|
|
|
)
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
# vim:set ts=2 sw=2 et:
|