NetBSD-Users archive

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

Re: Running a service on a console in the foreground



On Sun, 20 Nov 2022, Benny Siegert wrote:
Hi!

Is it possible to have some program running in the foreground on one of the VTs on startup, instead of getty? I would like it to start up on boot and use the console for input and output. How do you set up such a thing, or is this simply not supported?

If I grasped right what you want to do, I would let getty initialize the tty, define a custom type in /etc/gettytab like:

[...]
# just add al to Pc
autologin:\
        :al=your_user_name:np:ig:ht:
[...]

an configure your desired tty in /etc/ttys:

[...]
ttyE1   "/usr/libexec/getty autologin"  wsvt25  on secure
[...]

Then add something like this in your_user_name's .profile
[...]
if tty | grep -q /dev/ttyE1; then
    exec $YOURPROGAM
fi
[...]

But be aware, now ttyE1+$YOURPROGRAM is an open door to your_user_name's
account.


Home | Main Index | Thread Index | Old Index