From: Denis Pynkin Date: Tue, 19 Aug 2014 15:31:03 +0000 (+0300) Subject: Additional checks in ALTLinux template X-Git-Tag: lxc-1.1.0.alpha2~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=05e61b82cff6c44621e7d23bf3cbb756f3ae681b;p=thirdparty%2Flxc.git Additional checks in ALTLinux template Added check of services in container before start or stop. Added check of syslog config existence prior changing. Signed-off-by: Denis Pynkin Acked-by: Stéphane Graber --- diff --git a/templates/lxc-altlinux.in b/templates/lxc-altlinux.in index 828c68c10..1c5084ed1 100644 --- a/templates/lxc-altlinux.in +++ b/templates/lxc-altlinux.in @@ -108,16 +108,22 @@ EOF echo "pts/0" >> ${rootfs_path}/etc/securetty echo "console" >> ${rootfs_path}/etc/securetty - chroot ${rootfs_path} chkconfig network on - chroot ${rootfs_path} chkconfig syslogd on - chroot ${rootfs_path} chkconfig random on - chroot ${rootfs_path} chkconfig rawdevices off - chroot ${rootfs_path} chkconfig fbsetfont off -# chroot ${rootfs_path} chkconfig keytable off + # Enable services + for service in network syslogd random + do + chroot ${rootfs_path} chkconfig $service --list &>/dev/null && chroot ${rootfs_path} chkconfig $service on || true + done + # Disable services + for service in rawdevices fbsetfont + do + chroot ${rootfs_path} chkconfig $service --list &>/dev/null && chroot ${rootfs_path} chkconfig $service off || true + done subst 's/^\([3-9]\+:[0-9]\+:respawn:\/sbin\/mingetty.*\)/#\1/' ${rootfs_path}/etc/inittab echo "c1:2345:respawn:/sbin/mingetty --noclear console" >> ${rootfs_path}/etc/inittab - subst 's,\/dev\/tty12,/var/log/syslog/console,' ${rootfs_path}/etc/syslog.conf + + [ -f "${rootfs_path}/etc/syslog.conf" ] && \ + subst 's,\/dev\/tty12,/var/log/syslog/console,' ${rootfs_path}/etc/syslog.conf dev_path="${rootfs_path}/dev" rm -rf ${dev_path}