/proc/<pid>/cmdline and udhcpcd

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Wed Mar 26 11:46:31 UTC 2014


On Wed, 26 Mar 2014, Ralf Friedl wrote:
> Matt Whitlock wrote:
> > On Tuesday, 25 March 2014, at 10:52 pm, Cristian Ionescu-Idbohrn wrote:
> >> I find out that using that option:
> >>
> >> 	-x hostname:foo
> >> 	           ^
> >>
> >> shows up in /proc/<pid>/cmdline as:
> >>
> >> 	-x hostname foo
> >> 	           ^
> > /proc/<pid>/cmdline reflects any changes that the process has made
> > to its argv array.
>
> My guess is also that udhcpcd does something like
>      strchr(hostname, ':') = '\0';

I was suspecting something like that, but had difficulties to locate
where in the code that is being done.

Denys,

Is it possible to restrain from modifying the arguments for the
command line?  The problem is that the process watcher used here is
dependant on having the original/unmodified /proc/<pid>/cmdline.  If
the watched process dies, the cmdline is used to respawn it.
Respawning it with an erroneous command line creates a respawn loop.


Cheers,

-- 
Cristian


More information about the busybox mailing list