Univention Bugzilla – Bug 38259
halt/shutdown/reboot inside docker /sbin/init container leaves container running
Last modified: 2018-04-13 12:22:33 CEST
When a Docker (v 1.3.3) container is created with /sbin/init as PID 1 process, a reboot/halt/shutdown started in the container stops all processes but the PID 1 itself. This seems to be a special behavior of sysvinit to never exit by itself. Sending strong signals also doesn't help (the source code indicates as much). Similar behavior has been reported for upstart ( https://github.com/docker/docker/issues/1960 ). As a workaround we may re-place /etc/init.d/reboot by a UCR template which e.g. checks if a special "docker" UCR variable is set and finally runs "init 2" in this case. Or we ship our own /etc/rc6.d/S99reinit script instead.
It could also be that a newer version of docker can deal with "reboot -f". A characteristic sign for this issue are docker containers wich only have PID TTY STAT TIME COMMAND 1 ? Ss 0:00 init [6] running.
*** This bug has been marked as a duplicate of bug 39474 ***