why are init's arguments wiped ?
carrier.nicolas0 at gmail.com
Mon Feb 1 13:34:59 UTC 2016
We're back to square one since I'm using linux, but it's not the kernel
which launches this pid 1, in a container context.
2016-02-01 14:26 GMT+01:00 Ralf Friedl <Ralf.Friedl at online.de>:
> Nicolas CARRIER schrieb:
>> "/proc/1/cmdline is not a standard Unix ..."
>> I absolutely don't know any other OS, be it Unix or not... But don't they
>> provide a way to access the command-line used to launch a program ?
>> In busybox's code at least, I see only one implementation of
>> read_cmdline, which reads the content of /proc/[PID]/cmdline.
>> From that I conclude that only Unices having this file can have a busybox
>> ps implementation dealing with the command-line.
> Busybox is primarily intended for Linux. While some of the applets are
> Posix compliant, others are very Linux specific.
> Traditionally, Unix doesn't provide a way to access the comand-line of
> another program. Programs like ps used to do it anyway, but they had to be
> set-uid to root so that they could access the memory of another process.
> The whole /proc filesystem is not part of traditional Unix.
> What if I want to debug how init was launched ? The way it behaves now
>> makes it impossible to know if a runlevel has been passed, how it was
>> passed, or even if we are launching the right init binary.
> Assuming you use Linux, which you do, you can use /proc/cmdline to see the
> Kernel command line. From this you can determine which init was use. Either
> it was specified, or the default was used. It also contains the runlevel
> that was passed to init.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the busybox