[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: launched by rungetty bash breaks terminal input interpretation upon

From: Dumas Patrice
Subject: Re: launched by rungetty bash breaks terminal input interpretation upon runlevel change
Date: Fri, 7 Dec 2001 13:50:56 +0100
User-agent: Mutt/1.2.5i

Now that I have utmp (although I could have done without it, by using
$RUNLEVEL, but I didn't knew that), I try.

> I think init doesn't like this.  The first field should correspond to
> the tty, so using id "4" with tty1 won't work.  It follows that you
> can't run different commands on the same tty in different runlevels.
> But you can run a script in both runlevels.  The script could check
> the current runlevel, and exec the appropriate command line.  Then you
> would replace the two lines above with:
> 1:34:respawn:/path/to/script

Here is my /etc/inittab:

6:543:respawn:/sbin/rungetty tty6 -u root -g root  --noclear -- /bin/bash 

Here is /bin/start_exec:

set -x
if [ $RUNLEVEL = 3 ]; then
        exec /bin/bash --login
elif [ $RUNLEVEL = 4 ];then
        exec /bin/start_test
#end start_exec

And here is /bin/start_test
set -x
echo "test read $0"
read dummy 
#end start_test 

When I start in the runlevel 3 and then change runlevel, nothing change.
When I kill the bash process launched from the script, it restarts on the
current tty... I would like to have it on the tty1. 

When I modify start_exec such that there is
exec /sbin/rungetty tty1 -u root -g root  --noclear -- /bin/start_test
when I kill the process, init launch a new process which goes in the 
right tty, but there is still the problem of having <return> echoes ^M 
instead of making a new line.

I am a bit lost...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]