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

Kay Sievers kay at vrfy.org
Wed Sep 12 15:25:43 PDT 2012


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

Kay


More information about the systemd-devel mailing list