From: Denis Pynkin Date: Tue, 19 Aug 2014 15:31:03 +0000 (+0300) Subject: Additional checks in ALTLinux template X-Git-Tag: lxc-1.0.6~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71cb2a0dde282994f4d2f8b84b6aa4684c4717df;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 8694eb6f3..b9166aeef 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 # touch file for fastboot touch ${rootfs_path}/fastboot