#!/command/execlineb -P

# This file is executed (not as process 1!) as soon as s6-svscan
# starts. It should perform all the remaining one-time initialization
# tasks.

if -nt
{

# This should be logged in /mnt/tmpfs/uncaught-logs/current,
# NOT on /dev/console !
  if { s6-echo "* init-stage2 starting." }

# Call your service manager commands here to run the boot scripts.
  if { s6-rc-init /service }
  if { s6-rc -u change normal-state }

# We're done and the machine is fully operational.
  s6-echo "* init-stage2 completed."
}


# If anything in the if -nt { } block fails, control jumps here.
# No need to do much because there's already an operational getty running.

redirfd -w 1 /dev/console
s6-echo "\n!!!!!\ninit-stage2 failed, please log in and investigate.\n!!!!!"
