Hallo Laurent!
> > Sample tty_idle.c source:
> >
> > #include <unistd.h>
> >
> > int main( int argc, char* argv )
> > {
> > close(0);
> > close(1);
> > close(2);
> > while (1) pause();
> > }
>
> Hey Harald,
> Depending on your configuration, this will not work. Because you are
> doing more than you need - and in this case this might be harmful.
> Closing 0, 1 and 2 will normally remove all references to the terminal
> you are being executed in. Since your tty_idle program is the only user
> of ttyS0 at the time it is executed, closing those fds - and thus
> removing all references to ttyS0 - will make some kernels deconfigure
> the serial port, and you will have gained nothing.
> Don't close anything, just pause(), and you will keep the serial line
> open.
My indention was to release the line completely, not to hold the line.
You are true. Exec of tty_idle will close all references to the serial
device and let the kernel release any associated resources. Thereafter
you can open and access the ttySx device in any way you like, which
truly needs full initialization of the serial interface. ... I thought
this to be the requested behaviour. The idea of this is to release the
serial line but keep the getty from being respawned.
This example tty idle program is a bare minimum program I used whenever
I needed to steel a line away from normal login processing for other
purposes. Depending of the type of system and version other actions
may be necessary to achieve this. So this a only quick hack, which shall
work on most modern Linux systems.
--
Harald
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox