[Unit]
Description=inithooks: firstboot and everyboot initialization scripts
After=getty@tty1.service
ConditionKernelCommandLine=!noinithooks
ConditionPathExists=!/var/lib/turnkey-info/inithooks.service/xen
ConditionPathExists=!/var/lib/turnkey-info/inithooks.service/lxc
ConditionPathExists=!/var/lib/turnkey-info/inithooks.service/openstack

[Service]
Type=oneshot
StandardInput=tty-force
StandardOutput=syslog+console
StandardError=syslog+console
TTYPath=/dev/tty8
TTYReset=yes
TTYVHangup=yes
TTYVTDisallocate=yes
EnvironmentFile=/etc/default/inithooks
ExecStart=/bin/sh -c '\
    FGCONSOLE=$(fgconsole); \
    openvt -f -c 8 -s -w -- ${INITHOOKS_PATH}/run; \
    chvt $FGCONSOLE'
TimeoutStartSec=infinity

[Install]
WantedBy=multi-user.target
