git: 9front

Download patch

ref: a4d557eaac135dbce12f21f296ad14c00f9092c7
parent: 9c36bc58ea8cf4baff57ec34044fbd608cd4f3da
author: stanley lieber <stanley.lieber@gmail.com>
date: Wed Apr 20 23:10:08 EDT 2011

fshalt: fix for cwfs.

--- a/rc/bin/fshalt
+++ b/rc/bin/fshalt
@@ -17,37 +17,13 @@
 
 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}
 c=`{ls /srv/cwfs*cmd >[2]/dev/null}
 
-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
-
 for (i in $k){
 	echo -n $i... 
 	switch($i){
@@ -59,24 +35,19 @@
 	sleep 2
 }
 
-for (i in $c){
-	echo -n $i...
-	echo halt >>$i
-	sleep 2
-}
-
 # halting (binaries we run can't be on the fs we're halting)
 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
 
@@ -85,15 +56,6 @@
 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){
@@ -102,6 +64,11 @@
 		case *
 			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
--