[BusyBox] vfork_daemon_rexec

Vladimir N. Oleynik dzo at simtreas.ru
Tue Nov 25 12:47:56 UTC 2003


Russ,

>>>(btw, vfork_daemon_rexec doesn't work for me, it just says
>>>f: applet not found)
>>
>>Have your argv[0] valid name?
> 
> 
> char **vfork_args;
> int a = 0;
> 
> vfork_args = xcalloc(sizeof(char *), argc + 3);
> while(*argv) {
>     vfork_args[a++] = *argv;
>     argv++;
> }
> vfork_args[a] = foreground_opt;
> execvp("/proc/self/exe", vfork_args);

> vfork_args[0] = "/bin/busybox";
> execv(vfork_args[0], vfork_args);

Ok. This two line must change to one line (not tested, only idea):
execv("bin/busybox", vfork_args);

> bb_perror_msg_and_die("execv %s", vfork_args[0]);
> 
> argv[0] will always be /bin/busybox. argv[1] will probably be foreground
> op. (execvp falls through since /proc/self/exe isn't implemented)
> 
> thus the command would be:
> 
> /bin/busybox -f

busybox applet is not daemon and don`t call vfork_rexec().
Your argv[0] must have daemon name always or this strange problem.


--w
vodz





More information about the busybox mailing list