[BusyBox] init & ash & job control

WILSON,RICH (A-LakeStevens,ex1) rich_wilson at agilent.com
Thu May 2 10:39:05 UTC 2002


I found the problem.
In init.c line 585,

   safe_strncpy(buf + sizeof("exec "), a->command,
         sizeof(buf) - sizeof("exec ")); 

should be

   safe_strncpy(buf + sizeof("exec ")-1, a->command,
         sizeof(buf) - sizeof("exec ")+1); 

(or use strlen)

This caused init targets with redirection to turn into "/bin/sh exec "
which didn't leave much for ash to do.

Rich

Rich Wilson
Agilent Technologies
425-335-2245
rich_wilson at agilent.com

> -----Original Message-----
> From: busybox-admin at busybox.net [mailto:busybox-admin at busybox.net]On
> Behalf Of Richard Wilson
> Sent: Wednesday, May 01, 2002 1:27 PM
> To: busybox at busybox.net
> Subject: [BusyBox] init & ash & job control
> 
> 
> I'm trying to modify a working embedded system to replace
> much of it with busybox.  However, I'm having some startup
> problems.
> 
> In particular, I can't seem to get job control for my ash shell.
> 
> If inittab contains something like
>    ::respawn:-/bin/sh
> I get the message "sh: can't access tty; job control turned off"
> If inittab contains something like
>    ::respawn:/bin/sh -i </dev/ttyS0 >/dev/ttyS0 2>/dev/ttyS0
> then sh (busybox ash) exits immediately, and gets restarted
> again and again.
> 
>   Process '/bin/sh -i </dev/ttyS0 >/dev/ttyS0 2>/dev/ttyS0' \
>   (pid 20) exited. Scheduling it for restart.
>   Starting pid 21, console /dev/console; '/bin/sh'
> 
> System:
>   Power pc with serial console
>   Kernel 2.4.14.modified for my hardware
>   uClibc-0.9.11
>   busybox-0.60.3 (static linked to uClibc)
> 
> If I replace busybox-init with MontaVista's version of init
> (and change inittab appropriately) it works as desired.
> 
> If I replace busybox with montaVista busybox, which is
> compiled with libc.so.6 (dynamic), it works as desired.
> 
> In both cases, I need to add the redirections to inittab to
> get job control.
> 
> Help!
> 
> tia
> 
> Rich Wilson
> rich_wilson at agilent.com
> 
> [no cut-and-paste above; may be typing errors]
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://busybox.net/mailman/listinfo/busybox



More information about the busybox mailing list