startup 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #!/cmd/rc
  2. # cpu server start up
  3. date > /env/boottime
  4. # mount points
  5. mntgen -s slashn && chmod 666 /srv/slashn
  6. # name translation, cs sets /dev/sysname
  7. ndb/cs
  8. SYSNAME=`{cat /dev/sysname}
  9. # parallelism for mk
  10. NPROC = `{wc -l </dev/sysstat}
  11. # site-specific startup
  12. if(test -e /arch/rc/cmd/cpurc.local)
  13. . /arch/rc/cmd/cpurc.local
  14. if (~ $#SYSNAME 0 || ~ $SYSNAME '') {
  15. SYSNAME = jehanne # default
  16. echo -n $SYSNAME >/dev/sysname
  17. }
  18. PROMPT=($SYSNAME^'# ' ' ')
  19. # cpu-specific startup
  20. if(test -e /cfg/$SYSNAME/cpurc)
  21. . /cfg/$SYSNAME/cpurc
  22. # start up internet if we don't already have an address
  23. if(! grep u /net/ipselftab | grep -sv 127.0.0.1)
  24. ip/ipconfig
  25. if(! grep -s 127.0.0.1 /net/ipselftab)
  26. ip/ipconfig loopback /dev/null 127.1
  27. # if we're not a server, start a dns resolver
  28. if(! test -e /srv/dns)
  29. ndb/dns -r
  30. # If you are on an auth server, start these before listening:
  31. #
  32. # auth/keyfs -wp -m /mnt/keys /adm/keys >/dev/null >[2=1]
  33. # auth/cron >>/sys/log/cron >[2=1] &
  34. # keep other bootes processes from creating capabilities
  35. rm -f '#¤/caphash'
  36. # also rename some files on an auth server:
  37. #
  38. # if(! test -e /arch/rc/cmd/service.auth/tcp567){
  39. # mv /arch/rc/cmd/service.auth/authsrv.il566 /arch/rc/cmd/service.auth/il566
  40. # mv /arch/rc/cmd/service.auth/authsrv.tcp567 /arch/rc/cmd/service.auth/tcp567
  41. # mv /arch/rc/cmd/service/il566 /arch/rc/cmd/service/_il566
  42. # mv /arch/rc/cmd/service/tcp567 /arch/rc/cmd/service/_tcp567
  43. # }
  44. # netssh
  45. # start listeners if it hasn't already been done (dicey check)
  46. if(! netstat -n | grep -s 'tcp.*Listen.* (7|9|21|22|23|25|110|113|565|993|17007|17009|17010) .*')
  47. ip/listen -q tcp
  48. # TODO: Removed until awk works
  49. #if(! ps|grep -s timesync) {
  50. # aux/timesync -n pool.ntp.org
  51. # if (test -e '#r/rtc') @ {
  52. # sleep 10 # let timesync correct the time
  53. # awk '{print $1}' /dev/time >'#r/rtc' # fix hw clock
  54. # } &
  55. #}
  56. # cpu-specific late startup
  57. if(test -e /cfg/$SYSNAME/cpustart)
  58. . /cfg/$SYSNAME/cpustart
  59. # mode of /proc/*/ctl is inherited across rfork, and sets modes on
  60. # other /proc files, such as note, so let listen be killed.
  61. #dontkill '^(ipconfig|factotum|mntgen|venti|fossil|cs|dns|reboot)$'
  62. ip/listen1 -t -v tcp!*!1522 /cmd/hmi/pipeconsole /cmd/rc -m /arch/rc/lib/rcmain -i &
  63. if(test ! -e '#s/comconsole')
  64. hmi/comconsole '#t/eia0' /cmd/rc -m/arch/rc/lib/rcmain -i &
  65. echo 'key proto=p9sk1 dom=jehanne user=glenda !password=demodemo' >/mnt/factotum/ctl
  66. ip/listen1 -t tcp!*!17010 /cmd/cpu -R &
  67. # echo `{date} $SYSNAME >>/sys/log/boot
  68. exit ''