[systemd-devel] systemd-nspawn and kernel command line

Shawn Landden shawn at churchofgit.com
Sat Dec 7 11:30:08 PST 2013


On Sat, Dec 7, 2013 at 11:03 AM, Colin Guthrie <gmane at colin.guthr.ie> wrote:
> 'Twas brillig, and Shawn Landden at 07/12/13 18:57 did gyre and gimble:
>> On Sat, Dec 7, 2013 at 10:33 AM, Colin Guthrie <gmane at colin.guthr.ie> wrote:
>>> Hi,
>>>
>>> When playing with systemd-nspawn, is there a way to override the kernel
>>> command line seen inside the container. I mean it's probably not correct
>>> that the host systems /proc/cmdline leaks into the container.
>
>> No it is not, /proc/cmdline cannot be changed. What is your use case?
>> Perhaps this could be added to UTS namespaces?
>
> Could you not bind mount over it with a temporary file? Might be kinda
> tricky to do tho' if it is possible.
I didn't think of this. This is totally possible, and should now work
in recent git.
(but not any released versions)
--bind=/foo/newcmdline:/proc/cmdline

where newcmdline is a regular file
>
> My main use case is that we have a rescue system which passes "rescue"
> on the command line of the host system.
>
> If I use this system to "boot" containers (which would typically be the
> system we are "rescuing", then it reads this "rescue" is read in the
> container and starts rescue.target automatically rather than whatever
> default.target is. We'd probably want to specifically boot a
> multi-user.target by default and the best way to do that temporarily
> would be to provide a fake "command line" to the booted instance.
>
> Now we could change what we use to identify our rescue image, but it
> would seem to me that this shouldn't be needed and faking kernel command
> lines as seen by containers should be something that's possible.
>
> Cheers!
>
> Col
>
>
>
>
>
> --
>
> Colin Guthrie
> gmane(at)colin.guthr.ie
> http://colin.guthr.ie/
>
> Day Job:
>   Tribalogic Limited http://www.tribalogic.net/
> Open Source:
>   Mageia Contributor http://www.mageia.org/
>   PulseAudio Hacker http://www.pulseaudio.org/
>   Trac Hacker http://trac.edgewall.org/
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


More information about the systemd-devel mailing list