Adding a script do make dbus work inside a container running systemd, thanks to Nik...
authorDaniel Baumann <mail@daniel-baumann.ch>
Tue, 28 May 2013 12:27:27 +0000 (14:27 +0200)
committerDaniel Baumann <mail@daniel-baumann.ch>
Tue, 28 May 2013 12:27:27 +0000 (14:27 +0200)
scripts/debconfig/0220-dbus [new file with mode: 0755]
scripts/debconfig/0220-dbus.templates [new file with mode: 0644]

diff --git a/scripts/debconfig/0220-dbus b/scripts/debconfig/0220-dbus
new file mode 100755 (executable)
index 0000000..aad4745
--- /dev/null
@@ -0,0 +1,62 @@
+#!/bin/sh
+
+## live-debconfig(7) - System Configuration Scripts
+## Copyright (C) 2006-2013 Daniel Baumann <mail@daniel-baumann.ch>
+##
+## This program comes with ABSOLUTELY NO WARRANTY; for details see COPYING.
+## This is free software, and you are welcome to redistribute it
+## under certain conditions; see COPYING for details.
+
+
+set -e
+
+DEBCONF_SYSTEMRC="/var/lib/live/debconfig/systemrc"
+export DEBCONF_SYSTEMRC
+
+. /usr/share/debconf/confmodule
+
+if [ ! -e /lib/systemd/systemd ]
+then
+       # System does not use systemd
+       exit 0
+fi
+
+if [ ! -e /usr/bin/dbus-daemon ]
+then
+       # dbus not installed
+       exit 0
+fi
+
+Defaults ()
+{
+       _OOMSCOREADJUST="${_OOMSCOREADJUST:-true}"
+}
+
+db_get live-debconfig/dbus/oomscoreadjust
+_OOMSCOREADJUST="${RET}" # boolean
+
+Defaults
+
+db_set live-debconfig/dbus/oomscoreadjust "${_OOMSCOREADJUST}"
+db_fset live-debconfig/dbus/oomscoreadjust seen false
+
+db_settitle live-debconfig/title
+db_input high live-debconfig/dbus/oomscoreadjust || true
+db_go
+
+db_get live-debconfig/dbus/oomscoreadjust
+_OOMSCOREADJUST="${RET}" # boolean
+
+db_stop
+
+case "${_OOMSCOREADJUST}" in
+       false)
+               # Updating service file
+               sed -e 's|^ *OOMScoreAdjust|\#&|' /lib/systemd/system/dbus.service > /etc/systemd/system/dbus.service
+               ;;
+
+       true)
+               # Reenable sulogin
+               rm -f /etc/systemd/system/dbus.service
+               ;;
+esac
diff --git a/scripts/debconfig/0220-dbus.templates b/scripts/debconfig/0220-dbus.templates
new file mode 100644 (file)
index 0000000..7019a3d
--- /dev/null
@@ -0,0 +1,12 @@
+Template: live-debconfig/title
+Type: title
+Description: live-debconfig: System Configuration
+
+Template: live-debconfig/dbus/oomscoreadjust
+Type: boolean
+Default: true
+Description: live-debconfig: OOMScoreAdjust in dbus' systemd service?
+ The OOMScoreAdjust configuration parameter in the dbus systemd service can be removed.
+ This is only required in a Linux container (LXC) where OOMScoreAdjust is not allowed.
+ .
+ This defaults to true.