Hi all. I have an embedded system with a serial line hooked up to
either ttyS0 or ttyS1, depending on the kind of hardware. I want to put
a login session on it so that it doesn't just give a shell prompt when
people attach to it.
So, I had this in my inittab:
# Allow login on the console
tty0::askfirst:/bin/login
ttyS0::askfirst:/bin/login
ttyS1::askfirst:/bin/login
This worked OK, with one problem: the /bin/login spawned on the serial
line that did NOT exist, failed: /bin/login exits because it cannot open
the tty. Then init sees that /bin/login fails and respawns it (I want
this to happen so that you can log in more than one time!)
Then /bin/login fails, then is respawned, etc. many times per second,
which puts a noticeable load on the system. The login on the serial
line that does exist, though, works perfectly.
So, to solve this I decided to try to configure the serial line after
the boot, once I figured out what kind of system I was on so I would
know which serial line to use. So, during the initial boot sequence in
rcS I figure this out, then echo 'ttyS0::askfirst:/bin/login'
>> /etc/inittab (or ttyS1 as appropriate). Then I "kill -HUP 1" to get
init to reload and start /bin/login.
This does work, BUT the line discipline or something is all messed up on
the tty. I enter the "root" username and it's printed again after I hit
return. Then it asks for a password and my password is displayed as I
type it, so noecho is not working. Then once I get a shell prompt none
of the editing works, either in the (ash) shell or in (busybox) vi,
etc.: in both environments the control command I type (tab, ^P, j, k,
etc.) are all printed to the screen and the operation they perform is
not shown (the cursor doesn't move, etc.) However, the commands DO take
effect; if I tab-complete and press RETURN the filename was completed
and the command runs. It's just the terminal display that's wrong.
I'm interested in any solution that moves me forward: either a way to
keep /bin/login from respawning on terminals that don't exist, or a way
to reset the terminal after modifying inittab, or anything else.
Full disclosure: I've used UNIX for more years than I like to admit
(>20) but terminal control is one area that I've skirted the edges of
and never really come to grips with.
Any help is appreciated, thanks!
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox