2016-11-25 17:18:40 +01:00
|
|
|
#!/cmd/rc
|
2016-11-29 23:13:24 +01:00
|
|
|
# cpu server start up
|
|
|
|
date > /env/boottime
|
2016-11-25 17:18:40 +01:00
|
|
|
|
2016-11-29 23:13:24 +01:00
|
|
|
# mount points
|
2016-11-25 17:18:40 +01:00
|
|
|
mntgen -s slashn && chmod 666 /srv/slashn
|
|
|
|
|
2016-11-29 23:13:24 +01:00
|
|
|
# name translation, cs sets /dev/sysname
|
|
|
|
ndb/cs
|
2017-10-22 13:22:37 +02:00
|
|
|
SYSNAME=`{cat /dev/sysname}
|
2016-11-25 17:18:40 +01:00
|
|
|
|
2016-11-29 23:13:24 +01:00
|
|
|
# parallelism for mk
|
|
|
|
NPROC = `{wc -l </dev/sysstat}
|
2016-11-25 17:18:40 +01:00
|
|
|
|
2016-11-29 23:13:24 +01:00
|
|
|
# site-specific startup
|
|
|
|
if(test -e /arch/rc/cmd/cpurc.local)
|
|
|
|
. /arch/rc/cmd/cpurc.local
|
2016-11-25 17:18:40 +01:00
|
|
|
|
2017-10-22 13:22:37 +02:00
|
|
|
if (~ $#SYSNAME 0 || ~ $SYSNAME '') {
|
|
|
|
SYSNAME = jehanne # default
|
|
|
|
echo -n $SYSNAME >/dev/sysname
|
2016-11-25 17:18:40 +01:00
|
|
|
}
|
2017-10-22 13:22:37 +02:00
|
|
|
PROMPT=($SYSNAME^'# ' ' ')
|
2016-11-25 17:18:40 +01:00
|
|
|
|
2016-11-29 23:13:24 +01:00
|
|
|
# cpu-specific startup
|
2017-10-22 13:22:37 +02:00
|
|
|
if(test -e /cfg/$SYSNAME/cpurc)
|
|
|
|
. /cfg/$SYSNAME/cpurc
|
2016-11-25 17:18:40 +01:00
|
|
|
|
2016-11-29 23:13:24 +01:00
|
|
|
# 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
|
2016-11-25 17:18:40 +01:00
|
|
|
|
2016-11-29 23:13:24 +01:00
|
|
|
# if we're not a server, start a dns resolver
|
|
|
|
if(! test -e /srv/dns)
|
2016-11-25 17:18:40 +01:00
|
|
|
ndb/dns -r
|
|
|
|
|
2016-11-29 23:13:24 +01:00
|
|
|
# If you are on an auth server, start these before listening:
|
|
|
|
#
|
|
|
|
# auth/keyfs -wp -m /mnt/keys /adm/keys >/dev/null >[2=1]
|
|
|
|
# auth/cron >>/sys/log/cron >[2=1] &
|
2016-11-29 21:02:54 +01:00
|
|
|
|
2016-11-29 23:13:24 +01:00
|
|
|
# keep other bootes processes from creating capabilities
|
|
|
|
rm -f '#¤/caphash'
|
2016-11-29 21:02:54 +01:00
|
|
|
|
2016-11-29 23:13:24 +01:00
|
|
|
# also rename some files on an auth server:
|
|
|
|
#
|
|
|
|
# if(! test -e /arch/rc/cmd/service.auth/tcp567){
|
|
|
|
# mv /arch/rc/cmd/service.auth/authsrv.il566 /arch/rc/cmd/service.auth/il566
|
|
|
|
# mv /arch/rc/cmd/service.auth/authsrv.tcp567 /arch/rc/cmd/service.auth/tcp567
|
|
|
|
# mv /arch/rc/cmd/service/il566 /arch/rc/cmd/service/_il566
|
|
|
|
# mv /arch/rc/cmd/service/tcp567 /arch/rc/cmd/service/_tcp567
|
|
|
|
# }
|
|
|
|
|
|
|
|
# netssh
|
|
|
|
|
|
|
|
# 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) .*')
|
|
|
|
ip/listen -q tcp
|
|
|
|
|
|
|
|
# TODO: Removed until awk works
|
|
|
|
#if(! ps|grep -s timesync) {
|
|
|
|
# aux/timesync -n pool.ntp.org
|
|
|
|
# if (test -e '#r/rtc') @ {
|
|
|
|
# sleep 10 # let timesync correct the time
|
|
|
|
# awk '{print $1}' /dev/time >'#r/rtc' # fix hw clock
|
|
|
|
# } &
|
|
|
|
#}
|
|
|
|
|
|
|
|
# cpu-specific late startup
|
2017-10-22 13:22:37 +02:00
|
|
|
if(test -e /cfg/$SYSNAME/cpustart)
|
|
|
|
. /cfg/$SYSNAME/cpustart
|
2016-11-29 23:13:24 +01:00
|
|
|
|
|
|
|
# mode of /proc/*/ctl is inherited across rfork, and sets modes on
|
|
|
|
# other /proc files, such as note, so let listen be killed.
|
|
|
|
#dontkill '^(ipconfig|factotum|mntgen|venti|fossil|cs|dns|reboot)$'
|
|
|
|
|
|
|
|
ip/listen1 -t -v tcp!*!1522 /cmd/hmi/pipeconsole /cmd/rc -m /arch/rc/lib/rcmain -i &
|
|
|
|
if(test ! -e '#s/comconsole')
|
|
|
|
hmi/comconsole '#t/eia0' /cmd/rc -m/arch/rc/lib/rcmain -i &
|
|
|
|
|
|
|
|
echo 'key proto=p9sk1 dom=jehanne user=glenda !password=demodemo' >/mnt/factotum/ctl
|
|
|
|
ip/listen1 -t tcp!*!17010 /cmd/cpu -R &
|
|
|
|
|
2017-10-22 13:22:37 +02:00
|
|
|
# echo `{date} $SYSNAME >>/sys/log/boot
|
2016-11-29 23:13:24 +01:00
|
|
|
exit ''
|