aboutsummaryrefslogtreecommitdiffstats
path: root/event.d/serial
blob: 6869090e53240bc421a88e27c7d7099b6e76842b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

start on fedora.serial-console-available *
stop on runlevel [016]

instance
pre-start script
	while /bin/true ; do
		LANG=C /sbin/initctl status rcS | grep -wq "rcS (stop) waiting" && break
		sleep 1
	done
	while /bin/true ; do 
		runlevel=$(/sbin/runlevel | /bin/awk '{ print $2 }')
		case "$runlevel" in 
			2|3|4|5)
				LANG=C /sbin/initctl status rc$runlevel | grep -wq "rc$runlevel (stop) waiting" && break
				;;
			*)
				;;
		esac
		sleep 1
	done
	/sbin/securetty $1
end script
exec /sbin/agetty /dev/$1 $2 vt100-nav
post-stop script
	if [ "$UPSTART_EVENT" != "${UPSTART_EVENT##fedora.serial-console-available}" ]; then
		initctl emit --no-wait fedora.serial-console-available $1 $2
	fi
end script