[systemd-devel] [PATCH] shutdown: do reboot() for openvz container
Lennart Poettering
lennart at poettering.net
Wed Sep 12 14:53:27 PDT 2012
On Wed, 12.09.12 14:47, Kir Kolyshkin (kir at openvz.org) wrote:
> >>This patch brings the reboot() back for OpenVZ container.
> >Turns out the normal Linux containers understand reboot() just fine
> >too.
>
> Please note though that the problem with reboot() wrt upstream containers
> was really nasty -- calling reboot inside container resulted in
> rebooting the
> whole system, not just the container.
Hmm, are you suggesting old kernels didn't virtualize reboot() in a PID
namespace? Do you happen to know which version that was? Note that we
don't support kernels older than 2.6.39 in systemd anyway, so if the
change was older than that I am not too concerned...
Also, the code I now added will first try reboot() and then fallback to
exit() if it failed with EPERM and we are in a container. That means
that the container tool can simply drop CAP_SYS_REBOOT from the
container and the right thing will happen.
> Can I hope that this will be backported to Fedora 17, in this way or
> another?
Hmm, I am usually quite conservative about that, but please create an
rhbz ticket asking for that. Thanks!
Lennart
--
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel
mailing list