From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <727c1cb3f5c1ad03aed5be71ecb2aaa5@plan9.bell-labs.com> Date: Sat, 6 Aug 2005 12:52:13 -0400 From: jmk@plan9.bell-labs.com To: 9fans@cse.psu.edu Subject: Re: [9fans] bootup menus... In-Reply-To: <42F4D749.2000405@moseslake-wa.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Topicbox-Message-UUID: 73fd25e0-ead0-11e9-9d60-3106f5b1d025 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=3D9pccpu, 9pccpu menuitem=3Dmanual, manual menuconsole=3D0, 9600 menudefault=3D9pccpu, 5 [9pccpu] bootfile=3Dether0!/386/9pccpu [manual] [common] ether0=3Dtype=3Di82557 console=3D0 Locally we run a different cpurc which calls out to local files: #!/bin/rc boottime=3D`{date} boottime=3D$"boottime # parallelism for mk NPROC=3D`{wc -l /dev/sysstat} NPROC=3D`{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=3D`{cat /dev/sysname} prompt=3D($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 '#=C2=A4/caphash' > /dev/null >[2=3D1] # 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