#! /sbin/runset

# This is the main multiuser runset script.

PATH=/bin:/sbin:/usr/bin:/usr/sbin

# First, we mount the proc filesystem, which is handy to have
filesystem proc /proc

# Now we do the early startup, checking the filesystems and
# initalizing the network.  The "leave" command makes a note
# to run a second script when shutting down, to reverse
# some things.
leave /etc/rs.d/primary-wrapup
wait /etc/rs.d/primary-startup

# Now we remount the root filesystem writable
flags=remount filesystem ext2 / /dev/sda1

# And mount the other filesystems and swap partitions.
swap /dev/sda2
flags=ro filesystem ext2 /usr /dev/sda3
filesystem ext2 /var /dev/sda4

# There's a bit more setup work to do -- minor stuff like setting a
# custom VGA font.  This stuff needs /usr, so it couldn't be done in
# primary-startup.
# Again, there's a second "wrapup script" specified.  (Actually this one
# doesn't reverse what secondary-startup does -- it cleans up the virtual
# consoles)

leave /etc/rs.d/secondary-wrapup
wait /etc/rs.d/secondary-startup

# Load up some of the more important daemons.
once syslogd -n
once ntpd -n

# And we run the switch program
#
# grace=-1 declares that switch has no time limit during shutdown.
# without this parameter, programs are SIGKILLed after 10 seconds, which
# would be messy for switch.
grace=-1 once switch servers

# This command initializes the /var/run/utmp file, an obscure database
# vital for getty programs to work.  This also causes a boot record to be
# committed to the /var/log/wtmp file.
openutmp

# And finally, the gettys
utmp=2 respawn mingetty tty2
utmp=3 respawn mingetty tty3
utmp=4 respawn mingetty tty4
utmp=5 respawn mingetty tty5
utmp=6 respawn mingetty tty6
