#
# This service starts the configured number of gettys.
start on runlevel 2

env ACTIVE_CONSOLES=/dev/tty[1-5]
task
script
	#. /etc/sysconfig/init
	ACTIVE_CONSOLES=/dev/tty[1-5]
	for tty in $(echo $ACTIVE_CONSOLES) ; do
		echo initctl start tty TTY=$tty
		initctl start tty TTY=$tty
	done
	# support XEN PV console
	# FIXME: this is untested
	if [ -c /dev/xvc0 ] ; then
		echo initctl start tty TTY=/dev/xvc0
		initctl start tty TTY=/dev/xvc0
	fi
	# support HVC console on Power
	if [ -c /dev/hvc0 ] ; then
		echo initctl start tty TTY=/dev/hvc0
		initctl start tty TTY=/dev/hvc0
	fi
	# support serial console on Power
	if [ -c /dev/hvsi0 ] ; then
		echo initctl start tty TTY=/dev/hvsi0
		initctl start tty TTY=/dev/hvsi0
	fi
end script
