lxc under debian: flood of “init: Id “4” respawning too fast: disabled for 5 minutes” in the syslog and large /var/log/wtmp

docker seems to be the new fad… which i don’t use at all; but i’m quite happy with lxc and have it deployed in the production on couple of servers.

when i use it out of the box on debian there are few issues. one of them – guests have syslog flooded with repeated messages:

Sep 23 06:41:01 xxx init: Id "6" respawning too fast: disabled for 5 minutes
Sep 23 06:41:01 xxx init: Id "5" respawning too fast: disabled for 5 minutes
Sep 23 06:41:01 xxx init: Id "4" respawning too fast: disabled for 5 minutes
Sep 23 06:41:02 xxx init: Id "1" respawning too fast: disabled for 5 minutes
Sep 23 06:41:02 xxx init: Id "3" respawning too fast: disabled for 5 minutes
Sep 23 06:41:02 xxx init: Id "2" respawning too fast: disabled for 5 minutes

and /var/log/wtmp is counted in hunderds of megabytes instead of few hundreds kb. solution – edit /etc/inittab of each of the guests and change from

1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6

to

1:2345:respawn:/sbin/getty 38400 console
c1:23:respawn:/sbin/getty 38400 console
#3:23:respawn:/sbin/getty 38400 tty3
#4:23:respawn:/sbin/getty 38400 tty4
#5:23:respawn:/sbin/getty 38400 tty5
#6:23:respawn:/sbin/getty 38400 tty6

unfortunately i don’t remember where / how exactly did i discover it. possibly via this or similar tutorial.

once we are at it.. there was another problem i faced – syslog messages were corrupted on the host machine until i’ve followed this and reconfigured all lxc guests to have

lxc.cap.drop = sys_module mac_admin syslog

instead of

lxc.cap.drop = sys_module

in their definitions.

and – based on this post – modified /etc/rsyslog.conf of each of the guests and comment out:

$ModLoad imklog

Leave a Reply

Your email address will not be published. Required fields are marked *

 

(Spamcheck Enabled)