summaryrefslogtreecommitdiff
path: root/testing/systemd/systemd.install
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-04-03 00:01:35 +0000
committerroot <root@rshg054.dnsready.net>2012-04-03 00:01:35 +0000
commitc7cb603f86b4d4fb6567e3faa15b916a306f7004 (patch)
treebfdbca0002d6aeecc13f29a1c14d3991e6e93d4c /testing/systemd/systemd.install
parent321f44e3a5da426309c4b6664af035c97f907565 (diff)
Tue Apr 3 00:01:35 UTC 2012
Diffstat (limited to 'testing/systemd/systemd.install')
-rw-r--r--testing/systemd/systemd.install54
1 files changed, 54 insertions, 0 deletions
diff --git a/testing/systemd/systemd.install b/testing/systemd/systemd.install
new file mode 100644
index 000000000..822108c0f
--- /dev/null
+++ b/testing/systemd/systemd.install
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+checkgroups() {
+ if ! getent group lock >/dev/null; then
+ groupadd -g 54 lock
+ fi
+}
+
+sd_booted() {
+ [ -e sys/fs/cgroup/systemd ]
+}
+
+post_install() {
+ checkgroups
+
+ if [ ! -f etc/machine-id ]; then
+ systemd-machine-id-setup
+ fi
+
+ echo "systemd has been installed to /bin/systemd. Please ensure you append"
+ echo "init=/bin/systemd to your kernel command line in your bootloader."
+}
+
+post_upgrade() {
+ checkgroups
+
+ if [ ! -f etc/machine-id ]; then
+ systemd-machine-id-setup
+ fi
+
+ if sd_booted; then
+ systemctl daemon-reload
+ systemctl daemon-reexec
+ fi
+
+ 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 sd_booted; then
+ systemctl try-restart systemd-logind.service
+ fi
+ fi
+}
+
+post_remove() {
+ if getent group lock >/dev/null; then
+ groupdel lock
+ fi
+}
+
+# vim:set ts=2 sw=2 et: