From bf35116f9d203dcafce808a6c7b3dd5a0db8afbc Mon Sep 17 00:00:00 2001 From: root Date: Tue, 2 Aug 2011 04:35:55 +0000 Subject: Tue Aug 2 04:35:55 UTC 2011 --- community-testing/systemd/systemd.install | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'community-testing/systemd/systemd.install') diff --git a/community-testing/systemd/systemd.install b/community-testing/systemd/systemd.install index b4228255d..a6c4dde12 100644 --- a/community-testing/systemd/systemd.install +++ b/community-testing/systemd/systemd.install @@ -1,13 +1,13 @@ #!/bin/sh checkgroups() { - getent group lock >/dev/null || groupadd -g 54 lock + usr/bin/getent group lock >/dev/null || usr/sbin/groupadd -g 54 lock } post_install() { checkgroups - [ -f etc/machine-id ] || systemd-machine-id-setup + [ -f etc/machine-id ] || bin/systemd-machine-id-setup echo "systemd has been installed to /bin/systemd. Please ensure you append" echo "init=/bin/systemd to your kernel command line in your bootloader." @@ -16,16 +16,27 @@ post_install() { post_upgrade() { checkgroups - [ -f etc/machine-id ] || systemd-machine-id-setup - systemctl daemon-reexec >/dev/null || : + [ -f etc/machine-id ] || bin/systemd-machine-id-setup + bin/systemctl daemon-reexec >/dev/null || : + + newpkgver=${1%-*} + oldpkgver=${2%-*} + + # catch v31 need for restarting systemd-logind.service + if [ "$newpkgver" -ge 31 ] && [ "$oldpkgver" -lt 31 ]; then + # but only if systemd is running + if [ -d sys/fs/cgroup/systemd ]; then + bin/systemctl try-restart systemd-logind.service + fi + fi } pre_remove() { - rm -f /etc/systemd/system/default.target + bin/rm -f etc/systemd/system/default.target } post_remove() { - getent group lock >/dev/null && groupdel lock + usr/bin/getent group lock >/dev/null && usr/sbin/groupdel lock } # vim:set ts=2 sw=2 et: -- cgit v1.2.3-54-g00ecf