4 |
- |
1 |
# Automatically start a configured serial console
|
|
|
2 |
#
|
|
|
3 |
# How this works:
|
|
|
4 |
#
|
|
|
5 |
# On boot, a udev helper examines /dev/console. If a serial console is the
|
|
|
6 |
# primary console (last console on the commandline in grub), the event
|
|
|
7 |
# 'fedora.serial-console-available <port name> <speed>' is emitted, which
|
|
|
8 |
# triggers this script. It waits for the runlevel to finish, ensures
|
|
|
9 |
# the proper port is in /etc/securetty, and starts the getty.
|
|
|
10 |
#
|
|
|
11 |
# If your serial console is not the primary console, or you want a getty
|
|
|
12 |
# on serial even if it's not the console, create your own event e.g.
|
|
|
13 |
# /etc/init/ttyS0.conf with content:
|
|
|
14 |
# # ttyS0 - agetty
|
|
|
15 |
# #
|
|
|
16 |
# # This service maintains a agetty on ttyS0.
|
|
|
17 |
#
|
|
|
18 |
# stop on runlevel [S016]
|
|
|
19 |
# start on runlevel [23]
|
|
|
20 |
#
|
|
|
21 |
# respawn
|
|
|
22 |
# exec agetty -h -L -w /dev/ttyS0 115200 vt102
|
|
|
23 |
#
|
|
|
24 |
# Do not edit this file directly. If you want to change the behaviour,
|
|
|
25 |
# please create a file serial.override and put your changes there.
|
|
|
26 |
|
|
|
27 |
start on fedora.serial-console-available DEV=* and stopped rc RUNLEVEL=[2345]
|
|
|
28 |
stop on runlevel [S016]
|
|
|
29 |
|
|
|
30 |
instance $DEV
|
|
|
31 |
respawn
|
|
|
32 |
pre-start exec /sbin/securetty $DEV
|
|
|
33 |
exec /sbin/agetty /dev/$DEV $SPEED vt100-nav
|
|
|
34 |
post-stop exec /sbin/initctl emit --no-wait fedora.serial-console-available DEV=$DEV SPEED=$SPEED
|
|
|
35 |
usage 'DEV=ttySX SPEED=Y - where X is console id and Y is baud rate'
|