[Main]
Type = oneshot
Version = 0.1.0
Description = "66-policy: spawn agetty on tty1 if none is running (66-PID1 has no rc.init)"
User = ( root )
Depends = ( early-getty-down hostname mount-rw )
Options = ( !log )
InTree = getty

[Start]
Execute = (
	# Give classic tty1 a moment to claim the VT first.
	foreground { sleep 1 }
	ifelse { pgrep -f "[a]getty.*tty1" }
	{ exit 0 }
	ifelse { test -e /dev/tty1 }
	{
		background {
			setsid /sbin/agetty -L -8 tty1 115200 linux
		}
		exit 0
	}
	exit 0
)
