2 # fshalt [-r] - sync (flush) and, if possible, halt all file servers
3 # and optionally reboot
12 echo usage: $0 '[-r]' >[1=2]
21 unmount /mnt/consoles >[2]/dev/null
22 kill consolefs | rc # don't compete with /mnt/consoles
25 k=`{ls /srv/kfs*cmd >[2]/dev/null|sort -r}
26 c=`{ls /srv/cwfs*cmd >[2]/dev/null}
34 disk/kfscmd -n `{echo $i | sed -n 's%/srv/kfs.(.*).cmd%\1%p'} sync
39 # for scram, don't scram other systems
45 # halting (binaries we run can't be on the fs we're halting)
48 cp /bin/dial/expect /tmp
49 cp /bin/disk/kfscmd /tmp
53 cp /rc/lib/rcmain /tmp/lib
62 # put this in a shell function so this rc script doesn't get read
63 # when it's no longer accessible
73 kfscmd -n `{echo $i | sed -n 's%/srv/kfs.(.*).cmd%\1%p'} halt
86 echo reboot >'#c/reboot'