[BusyBox] start_stop_daemon options to daemon
Axel Barnitzke
barney at xkontor.com
Wed May 15 09:57:05 UTC 2002
Hi Joerg,
Joerg Schmitz-Linneweber wrote:
>>start-stop-daemon -S -x /sbin/syslogd -C
>> ^^^
>>Has anybody done this before ?
>>
> If I understand GNU getopt right (and if the BB version of getopt is
> compatible :-) then you could "end" your options to start-stop-daemon with a
> "--". Everything afterwards will not get interpreted by that getopt.
> So perhaps a
> <pre>
> start-stop-daemon -S -x /sbin/syslogd -- -C
> </pre>
> works?
That worked -- thank you for the hint !
> After having written the above I understand that`s *not* the solution :-)
> You'll have to say start_stop_daemon that syslog _and_ -C are *one* option!
> So perhaps a
> <pre>
> start-stop-daemon -S -x "/sbin/syslogd -C"
> </pre>
> does the job. Or perhaps you'll have to use "some other" quotes...
Nope that can't work because the '-x' option is parsed as cmdname
to execv (see init/start_stop_daemon.c)
1.) case '-x': cmdname = optarg;
2.) argc -= optind; argv += optind;
3.) *--argv = cmdname;
4.) execv(cmdname, argv)
-- Barney
--------------------------------------
++ axel (barney) barnitzke
++ it consultant
++ xkontor IT solutions
fon :: +49 40 4100959-0
email :: mailto:barney at xkontor.com
More information about the busybox
mailing list