Others have pointed out boot(8), init(8) for documentation.
A plan9.ini file to do what you want with a 5 second timeout
and serial console might look something like this:

[menu]
menuitem=9pccpu, 9pccpu
menuitem=manual, manual
menuconsole=0, 9600
menudefault=9pccpu, 5

[9pccpu]
bootfile=ether0!/386/9pccpu

[manual]

[common]
ether0=type=i82557
console=0


Locally we run a different cpurc which calls out to local files:

#!/bin/rc
boottime=`{date}
boottime=$"boottime

# parallelism for mk
NPROC=`{wc -l /dev/sysstat}
NPROC=`{echo $NPROC|sed 's/ .*//'}

# get rid of need for dirs in /n
mntgen -s slashn && chmod 666 /srv/slashn

# cs sets /dev/sysname
ndb/cs
sysname=`{cat /dev/sysname}
prompt=($sysname^'# ' ' ')

# site specific startup
if(test -e /rc/bin/cpurc.local)
        . /rc/bin/cpurc.local

# cpu specific startup
if(test -e /cfg/$sysname/cpurc)
        . /cfg/$sysname/cpurc

# if we're not a server, start a dns resolver
if(! test -e /srv/dns)
        ndb/dns -r

# reboot if we lose the file server
aux/reboot

# turn on dong's tcp port hog defense
if( test -e /net/tcp/clone)
        echo -n tcpporthogdefense on > /net/tcp/0/ctl

# keep other bootes processes from creating capabilities
rm '#ยค/caphash' > /dev/null >[2=1]

# start up internet if we don't already have an address
if(! grep u /net/ipselftab | grep -sv 127.0.0.1)
        ip/ipconfig
if(! grep -s 127.0.0.1 /net/ipselftab)
        ip/ipconfig loopback /dev/null 127.1

# start listeners if it hasn't already been done (dicey check)
if(! netstat -n | grep -s 'tcp.*Listen.* 
(7|9|21|22|23|25|110|113|565|993|17007|17009|17010) .*')
        aux/listen -q tcp
if(! netstat -n | grep -v 17008 | grep -s il.*Listen)
        aux/listen -q il

if(! ps|grep -s timesync)
        aux/timesync -s /net -nl -d /sys/log/timesync.d oncore achille

# cpu specific startup
if(test -e /cfg/$sysname/cpustart)
        . /cfg/$sysname/cpustart

exit 0


/rc/bin/cpurc.local contains things like setting the
site, fileserver, facedom and default cpu variables and
anything else which is global to our site.

/cfg/$sysname/cpurc contains things specific to a
particular cpu server, such as starting daemons and
cron.

/cfg/$sysname/cpustart seems to be something added
since last I looked to give people another hook for
playing around. Some of the local instances seem to
be of dubious value...

We also use /cfg/$sysname to keep other machine-specific
files such as namespace, consoledb, copies of config
files like plan9.ini, venti.conf, etc. Sometimes there's
also a file of notes about the machine to aid in
recovery or replication if something bad happens.

--jim

Reply via email to