<div dir="ltr"><div>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.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-02-01 14:26 GMT+01:00 Ralf Friedl <span dir="ltr"><<a href="mailto:Ralf.Friedl@online.de" target="_blank">Ralf.Friedl@online.de</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Nicolas CARRIER schrieb:<span class=""><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
"/proc/1/cmdline is not a standard Unix ..."<br>
<br>
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 ?<br>
In busybox's code at least, I see only one implementation of read_cmdline, which reads the content of /proc/[PID]/cmdline.<br>
>From that I conclude that only Unices having this file can have a busybox ps implementation dealing with the command-line.<br>
</blockquote></span>
Busybox is primarily intended for Linux. While some of the applets are Posix compliant, others are very Linux specific.<br>
<br>
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.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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.<br>
</blockquote></span>
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.<br>
<br>
</blockquote></div><br></div>