Enabling a terminal for user logins using Upstart
If your distribution uses Upstart, you can use an Upstart job file to allow user logins on a terminal.
To enable user logins with Upstart, create an Upstart
job file with the following content:
start on runlevel [2345]
stop on runlevel [01]
respawn
exec /sbin/mingetty --noclear <dev>
You
can use a file name of your choice. The directory where you must locate
the file depends on your distribution.In the sample file, <dev> specifies
the device node of the terminal, omitting the leading /dev/
.
For example, instead of specifying /dev/sclp_line0,
specify sclp_line0
.
With mingetty,
you must explicitly export the TERM environment variable with the
terminal name. The terminal
name indicates the capabilities of the terminal device. Examples for
terminal names are
linux
, dumb
, xterm
,
or vt220
.mingetty example:
# export TERM=linux
Instead of mingetty, you can use agetty, which can set the TERM environment variable at startup.
To set the
TERM environment variable to
linux
and enable user
logins with Upstart create an Upstart job file with the following
content: start on runlevel [2345]
stop on runlevel [01]
respawn
exec /sbin/agetty -L 9600 <dev> linux
Example
The following Upstart job file
enables a device
hvc0
for user logins with mingetty.start on runlevel [2345]
stop on runlevel [01]
respawn
exec /sbin/mingetty --noclear hvc0