Re: [9fans] bootup menus...



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
.



Relevant Pages

  • Performance Problems.. Server hardware smoked by $500 box?
    ... webserver with a separate db/file server sitting behind it. ... Now granted the development machine has the most Mhz, ... CPU: Intel Pentium III Origin = ... Ubench CPU: 25713 ...
    (freebsd-performance)
  • Performance Problems.. Server hardware smoked by $500 box?
    ... webserver with a separate db/file server sitting behind it. ... Now granted the development machine has the most Mhz, ... CPU: Intel Pentium III Origin = ... Ubench CPU: 25713 ...
    (freebsd-questions)
  • Re: Chat server : Threading in select call
    ... on the same CPU. ... the server continues to make forward progress on ... For example, in the typical case, the server handles each request as ... any server where there is tight integration between connections (one ...
    (comp.unix.programmer)
  • Re: Dell PowerEdge 2450 & Win2k3 server
    ... The other thing you can do is try to run just one CPU and see if one of the ... Enterprise server sp1. ... I get this error after the windows setup process. ... Tried installing with the PERC and also tried installing using the ...
    (microsoft.public.windows.server.general)
  • ntlsap.exe??
    ... because the CPU was running 100% constantly. ... the Windows/System32 folder. ... internet references to this file, and it was not founf on ... but went into config and unchecked run at startup. ...
    (microsoft.public.windowsxp.general)