[BusyBox] init problem with init.c version 1.164 from CVS

cajus.hahn at de.abb.com cajus.hahn at de.abb.com
Thu Jul 25 02:32:05 UTC 2002


Vladimir,

thank you for the fast reply.

I did some more testing, the thing seems to be more complicated.
I have a system with a serial console, optional the system can be equiped
with a graphics board that gives the option of having some virtual ttys or
running some optional application with graphical output. The debug and
error output should always go to the serial port /dev/ttyS1, which is
normaly also the console. Additionaly there should run an askfirst-getty
(from tinylogin-stable) on that port to give a chance to login. If the
optional graphics board is installed, there is the possibility to use the
/dev/tty1 (a virtual console device) as console. In this case all debug
output should still go to /dev/ttyS1. To ensure this, the background
applications are started with
"app >/dev/ttyS1 2>&1 &" by a script from the once-action of init.
Later the getty is started with
::askfirst:/sbin/getty -Lt10 ttyS1 115200 vt100
The debug output from the background processes will appear on the serial
port as long as getty is NOT started.
Normally an "askfirst" action asks for pressing "Enter" and waits for the
key pressed, but on a the console (no difference between console beeing
/dev/tty1 or /dev/ttyS1) the askfirst action will be started anyway. In my
system the time between the message "Press Enter to activate this console."
and starting getty is about 7 sec. This could be the time all actions from
the inittab have been completed!? Any ideas?
Confusing: When I start the background applications with
"app >/dev/console 2>&1 &"
instead of
"app >/dev/ttyS1 2>&1 &"
the debugs will continue being printed on /dev/ttyS1 (if /dev/ttyS1 is the
console.) That would help if no optional graphics board is installed, but
in the case it is installed and the console is on a virtual tty (/dev/tty1)
it will print the debug to the virtual console device and not to the serial
port.
I tried the same procedure with
"app >/dev/tty1 2>&1 &".
Same result: when getty starts, debug output stops.
Do you have an idea why the output to /dev/console works and /dev/ttyS1
does not work, even if they use the same port?

By the way, what does "IHMO" mean ? (sorry I am not as experienced as you
with mailing list abbreviations ;-)

Cajus



                                                                                                     
 (Embedded     "Vladimir N. Oleynik" <dzo at simtreas.ru>@simtreas.ru                                   
 image moved   24.07.2002 18:14                                                                      
 to file:                                                                                            
 pic08974.pcx)                                                                                       
                                                                                                     
                                                                                                     


Sent by:    dzo at simtreas.ru


To:    cajus.hahn at de.abb.com
cc:    busybox at busybox.net
Subject:    Re: [BusyBox] init problem with init.c version 1.164 from CVS

Security Level:?              Internal


Cajus,

> I have some problems with the latest version of the init.c from the
stable
> CVS archive.
> I was using the version from busybox 0.60.3 stable before.
> In the inittab I start a script with the sysinit-action and another with
> the once-action.
> This scripts itself execute some applications, which continue runnig in
> background.
> Some of this applications print on their stdout (with printf).
> This output appears on the console.
> I can see the first few lines with output, then the output stops.
> It looks like the problem results in the exit of the init action.
> Some of my application exited completely (not only their output).
> I found out, that they got a SIGHUP, which made them quit.
> I solved this with a signal handler.

IHMO and should work.
If process start as background, you must drop controlling tty
or ignore sighup and rreopen stdin/stdout/stderr to /dev/null.
I can`t understand yours problems.

> Is the stdout of this init-childs closed when the init action exits?
> This problem does not occur with init.c from busybox 0.60.3 stable.


--w
vodz



-------------- next part --------------
A non-text attachment was scrubbed...
Name: pic08974.pcx
Type: application/octet-stream
Size: 128 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/busybox/attachments/20020725/6d0989ce/attachment.obj 


More information about the busybox mailing list