X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=rc%2Fbin%2Ffshalt;h=681311f1703ea4107b18f6144d80449662c342f1;hb=2908369aeb4b2c85f611c8329b65ae42e58f4f01;hp=f288786fb82f9d92eb874ac83d2cd1394fb9112b;hpb=a9060cc06bee66e12fe16644511f181a4b0cdbd3;p=plan9front.git diff --git a/rc/bin/fshalt b/rc/bin/fshalt old mode 100644 new mode 100755 index f288786fb..681311f17 --- a/rc/bin/fshalt +++ b/rc/bin/fshalt @@ -17,35 +17,12 @@ builtin cd / setrtc -# start venti flushing -venti/sync -h localhost >[2]/dev/null & -venti/sync >[2]/dev/null & - unmount /mnt/consoles >[2]/dev/null kill consolefs | rc # don't compete with /mnt/consoles sleep 1 -f=`{ls /srv/fscons*>[2]/dev/null} k=`{ls /srv/kfs*cmd >[2]/dev/null|sort -r} - -echo -n syncing... -for(i in $f) @ { - echo -n $i... - { - echo - dial/drain & - sleep 2 - echo fsys all sync - if(! dial/expect -t 120 ': ') - echo -n 'not synced...' > /dev/cons - } < $i >> $i -} - -# flush the last bit of possible fossil traffic -echo -n venti... -venti/sync -h localhost >[2]/dev/null & -venti/sync >[2]/dev/null & -sleep 5 +c=`{ls /srv/cwfs*cmd >[2]/dev/null} for (i in $k){ echo -n $i... @@ -62,14 +39,15 @@ for (i in $k){ ramfs builtin cd /tmp cp /bin/dial/expect /tmp -cp /bin/echo /tmp cp /bin/disk/kfscmd /tmp -cp /bin/rc /tmp -cp /bin/sed /tmp -cp /bin/ns /tmp +cp /bin/echo /tmp cp /bin/iostats /tmp mkdir /tmp/lib cp /rc/lib/rcmain /tmp/lib +cp /bin/ns /tmp +cp /bin/rc /tmp +cp /bin/sed /tmp +cp /bin/sleep /tmp bind /tmp /rc bind /tmp /bin @@ -78,15 +56,6 @@ bind /tmp /bin fn x { echo echo -n halting... - for(i in $f) @ { - echo -n $i... - { - echo fsys all halt - if(! expect -t 60 ': ') - echo -n 'not halted...' > /dev/cons - } < $i >> $i - } - for (i in $k){ echo -n $i... switch($i){ @@ -96,6 +65,11 @@ fn x { kfscmd -n `{echo $i | sed -n 's%/srv/kfs.(.*).cmd%\1%p'} halt } } + for (i in $c){ + echo -n $i... + echo halt >>$i + sleep 2 + } echo echo done halting