Bug 1244 testcase

Denis Vlasenko vda.linux at googlemail.com
Sun Mar 4 18:04:47 UTC 2007


Hi Eric,

On Sunday 04 March 2007 15:50, Eric Spakman wrote:
> > The attached standalone utility shall be able to automatically
> > do it for specified program. Usage:
> >
> > -::sysinit:/etc/init.d/rcS [args]
> > +::sysinit:/path/to/cttyhack /etc/init.d/rcS [args]
> >
> > It is not meant to be a permanent solution, I just want to check
> > whether the problem is caused by lack of ctty for sysinit actions.
> >
> > If it is true, then "real" fix is to determine why your sysinit
> > actions require ctty. They should not need it, I think.
> >
> > cttyhack may be useful and even may be added to bbox, but it is still an
> > ugly non-portable hack.
>
> This hack does indeed work, but I had to add it in 3 places:
> ::sysinit:/sbin/cttyhack /etc/init.d/rcS
> ::wait:/sbin/cttyhack /etc/init.d/rc 2
> ......
> ::shutdown:/sbin/cttyhack /etc/init.d/rc 0
> 
> to see boot and shutdown messages and to start/stop all the daemons and
> programs.
> 
> I have an updated Qemu image with cttyhack and changed inittab in
> ftp://espakman.dyndns.org/pub/denis/

Can you explain how can one *update* these images for testing?

> It's indeed strange that some daemons seem to need a controlling tty, at
> least dnsmasq, openntpd and ulogd won't start without and I can imagine

I suspect that daemons don't need it, but some script probably fails
before they have a chance to be started.

In order to find out where it breaks down, do *NOT* use cttyhack,
but use "exec >/dev/tty1 2>/dev/tty1 </dev/tty1" trick.
Move it further and further down the script until you find
the place where script starts to fail.

Or explain how I can modify the image, so I can experiment myself.

> there are more. Shorewall contains shell scripts and that won't seem to
> start either without the cttyhack.
> 
> But what's also annoying without a ctty is that no startup and shutdown
> output is shown, even when busybox init is compiled with
> "FEATURE_INIT_SCTTY and a "-" in the inittab.

I speculate that output is not shown because there is no output.
Script dies before it gets to output anything.
--
vda



More information about the busybox mailing list