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}
27 h=`{ls /srv/hjfs*cmd >[2]/dev/null}
35 disk/kfscmd -n `{echo $i | sed -n 's%/srv/kfs.(.*).cmd%\1%p'} sync
40 # for scram, don't scram other systems
45 if (test -e '#P'/acpitbls -a -e '#P'/iow)
49 # halting (binaries we run can't be on the fs we're halting)
52 cp /bin/dial/expect /tmp
53 cp /bin/disk/kfscmd /tmp
57 cp /rc/lib/rcmain /tmp/lib
66 # put this in a shell function so this rc script doesn't get read
67 # when it's no longer accessible
77 kfscmd -n `{echo $i | sed -n 's%/srv/kfs.(.*).cmd%\1%p'} halt
95 echo reboot >'#c/reboot'
99 echo 'It''s now safe to turn off your computer'