Re: Autologin on Serial Console
Simon Tennant wrote:
> I currently have a Dec VT320 hooked up to my Debian box via a serial line
> on /dev/ttyS1. This box sits in the kitchen spewing the output of a
> tcpdump and provides and interesting way to monitor network activity in
> the house.
> I currently have to login and run "tcpdump -i eth1". I'd like tcpdump to
> be run automatically when the console is powered up and for no input to be
> accepted from the keyboard.
> To that end I've investigated getty-ps and mgetty. Both want a login or
> at lease a username in the case of getty-ps.
> Has anyone successfully managed to get a prelogged in console working?
I've not done anything like this on Linux, but did a similar thing once
on a SCO Xenix system. Basically, you want to have the 'tcpdump'
program run with its I/O redirected to the terminal line. To do this,
you would have to disable logins on the serial line and have the tcpdump
start up in an rc script during boot, being sure it comes up after
networking support is initialized.
I did this in a shell script that first redirected its stdin/out/err to
point to the proper device (/dev/ttyS1 in your case). Since you don't
want keyboard input, you'd want to close the stdin part rather than
redirect it. You may also have to use 'stty' to set the serial line
parameters, since getty would do this normally (and you have disabled
I'm sorry I can't give you specifics at this point, I don't have access
to any UNIX system where I could play with this type of stuff (being as
root privileges are needed). Let me know if you need more help, though,
and I'll see what I can do later at home.
Staff Software Quality Engineer