On Friday 18 May 2007 19:00, David Daney wrote: > >> ttyS0::askfirst:-/bin/sh > >> > >> That will open the shell on a device that can be a controlling tty > >> (/dev/ttyS0). > > > > Why shouldn't you be able to use console (or ""), so that it follows the > > console wherever that is? (ttyS0, ttyS1, or a real linux virtual > > console). > > > > Like I said, the documentation says the above is an implicit rule if you > > have no inittab. The code appears to agree. > > You have a choice. > > If you want to suppress the bothersome message and be able to send > SIGINT to a process by pressing a key (typically ^C) do it my way. > > If you want the behavior obtained by doing it your way, change nothing. > > If you want all this documented somewhere, patches are welcome.
I think that there is indeed an understandable desire to start shell on the console and yet to have a ctty (have working ^C). Main reason is that this will automatically start shell on serial line or Linux vt - whichever is configured as console for the kernel. Otherwise, it's sort of not trivial where the console is. IOW: I think these complaints will never stop unless something is done about this. I decided to add an applet which helps with that. It's in svn now in "shells" section, it's called cttyhack and it has a nice (I hope) help text which explains its purpose: config CTTYHACK bool "cttyhack" default n help One common problem reported on the mailing list is "can't access tty; job control turned off" error message which typically appears when one tries to use shell with stdin/stdout opened to /dev/console. This device is special - it cannot be a controlling tty. Proper solution is to use correct device instead of /dev/console. cttyhack provides "quick and dirty" solution to this problem. It analyzes stdin with various ioctls, trying to determine whether it is a /dev/ttyN or /dev/ttySN (virtual terminal or serial line). If it detects one, it closes stdin/out/err and reopens that device. Then it executes given program. Usage example for /etc/inittab (for busybox init): ::respawn:/bin/cttyhack /bin/sh What you guys think about it? -- vda _______________________________________________ busybox mailing list busybox@busybox.net http://busybox.net/cgi-bin/mailman/listinfo/busybox