]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-debian.in: Fixed errors if dbus is not installed
authorCyril Bitterich <Cyril.Bitterich@1und1.de>
Sat, 9 May 2015 19:57:14 +0000 (21:57 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 14 Aug 2015 17:09:24 +0000 (13:09 -0400)
The lxc-debian template debootstraps a minimum debian system which does not contain dbus.
If systemd is used this will result in getty-static.service to be used instead of getty@ .
The systemd default files uses 6 tty's instead of the 4 the script creates.
This will lead to repeated error messages in the systemd journal.

Signed-off-by: Cyril Bitterich <Cyril.Bitterich@1und1.de>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
templates/lxc-debian.in

index 2df0136e34d8350bba9521ab27fb99530710d18d..7620b43d9a71041bfaff6738004d1db972c960eb 100644 (file)
@@ -196,6 +196,11 @@ configure_debian_systemd()
     mkdir -p ${rootfs}/{lib,etc}/systemd/system
     mkdir -p ${rootfs}/etc/systemd/system/getty.target.wants
 
+    # Fix getty-static-service as debootstrap does not install dbus
+    if [ -e $rootfs//lib/systemd/system/getty-static.service ] ; then
+        sed 's/ getty@tty[5-9].service//g' $rootfs/lib/systemd/system/getty-static.service |  sed 's/\(tty2-tty\)[5-9]/\14/g' > $rootfs/etc/systemd/system/getty-static.service
+    fi
+
     # This function has been copied and adapted from lxc-fedora
     rm -f ${rootfs}/etc/systemd/system/default.target
     touch ${rootfs}/etc/fstab