Bug 38259 - halt/shutdown/reboot inside docker /sbin/init container leaves container running
halt/shutdown/reboot inside docker /sbin/init container leaves container running
Status: RESOLVED DUPLICATE of bug 39474
Product: UCS
Classification: Unclassified
Component: Docker
UCS 4.0
Other Linux
: P5 normal (vote)
: ---
Assigned To: App Center maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2015-04-14 14:20 CEST by Arvid Requate
Modified: 2018-04-13 12:22 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.069
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Arvid Requate univentionstaff 2015-04-14 14:20:22 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.
Comment 1 Arvid Requate univentionstaff 2015-04-14 14:22:57 CEST
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.
Comment 2 Daniel Tröder univentionstaff 2017-05-02 11:02:43 CEST

*** This bug has been marked as a duplicate of bug 39474 ***