Skip to content

initscript: allow containers to reboot the machine at pipeline exit

Martin Roukala requested to merge reboot_support into master

So far, boot2container has been shutting down the machine when the container pipeline finished its execution, leaving interactive users puzzled has to why the machine shut down when they typed reboot.

It was possible for users to override the shutdown command using b2c.shutdown_cmd="reboot -f", but then users typing poweroff in their container would not get what they expected... Not really a user-friendly experience!

Luckily, the Linux kernel allows the userspace to tell whether the container got killed using reboot or shutdown, thanks to its use of a different signal number. Podman is then kind-enough to forward this information to us via its exit code, enabling us to record whether a container wanted us to poweroff or reboot \o/.

This commit implements and documents this new behaviour.

Closes: #26 (closed)

Cc: @v-a

Merge request reports