#!/bin/rc
# site-local cpu startup
# used only by upas, as default return domain appended to all unqualified
# return addresses, even local ones, and as one of the values of \l in rewrite.
site=thuychi.vn
fileserver=someone
facedom=FACEDOM
cpu=someone
JREGALLOC=30 # max risc-v register to allocate in [ij]c
# if no dns server yet, start one
DNSSERVER=1.1.1.1
# DNSSERVER=75.75.75.75
# DNSSERVER=96.78.174.36 # fw
# on file servers, configure network and ensure dns is running
if(~ $sysname fs) {
# configure primary network
if(test -e /net/ipifc/clone) {
if (~ $#ip 1)
ip/ipconfig -g $ipgw ether /net/ether0 $ip $ipmask
if not
ip/ipconfig
ipconfiged=done
}
addroutes
if(! test -e /srv/dns && ! test -e /env/dns) {
echo -n dns...
ndb/dns -rR # don't answer udp
dns=running # tell cpurc we've already got one
}
}
9fs other >[2]/dev/null &
# load keys into factotum; must be before listens
# without dd, this takes 10s of seconds on pf
if (test -r /adm/mailkeys) {
echo -n 'factotum mail & tls keys...'
dd -quiet 1 </adm/mailkeys -bs 8192 | read -m >>/mnt/factotum/ctl
}
# echo -n secstore...
# TODO: shouldn't need this any more, but factotum doesn't get it right
# auth/secstore -s pi4 -n -G factotum | read -m >>/mnt/factotum/ctl &
#if(! ~ $sysname 9vm) {
# echo -n pie...
# # make /srv/labs avail. to export before listens, don't hang
# await 2 9fs pie
#}
# ipv6on invokes ip/config 4 times and takes just under 10 seconds
#{
# ipv6on
# sleep 3
# if(! ~ $sysname fs)
# addroutes
#} &
if (test -e '#w/wdctl')
aux/watchdog &
|