[systemd-devel] [PATCH] shutdown: do reboot() for openvz container

Lennart Poettering lennart at poettering.net
Wed Sep 12 15:30:00 PDT 2012

On Thu, 13.09.12 00:25, Kay Sievers (kay at vrfy.org) wrote:

> On Wed, Sep 12, 2012 at 11:54 PM, Lennart Poettering
> <lennart at poettering.net> wrote:
> > On Wed, 12.09.12 11:51, Daniel P. Berrange (berrange at redhat.com) wrote:
> >> NB when libvirt starts an LXC container, it first checks to see whether
> >> the kernel has the container aware reboot() support. If it does not,
> >> then it removes CAP_SYS_REBOOT from the container, to prevent any
> >> accidental whole system reboot. The sf.net LXC tools do the same thing.
> >
> > How do you check that? A version check or can you actually detect this
> > feature explicitly?
> "Returning EINVAL is also an easy way to check if this feature is supported
> by the kernel when invoking another 'reboot' option like CAD."
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=commit;h=cf3f89214ef6a33fad60856bc5ffd7bb2fc4709b

But that's from inside the container. But LXC would need that from
outside the container?


Lennart Poettering - Red Hat, Inc.

More information about the systemd-devel mailing list