Browse Source

Plan 9 from Bell Labs 2004-02-11

David du Colombier 18 years ago
parent
commit
4bb21c8970
3 changed files with 34 additions and 22 deletions
  1. 1 1
      dist/replica/plan9.db
  2. 1 0
      dist/replica/plan9.log
  3. 32 21
      rc/bin/fshalt

+ 1 - 1
dist/replica/plan9.db

@@ -2991,7 +2991,7 @@ rc/bin/dosmnt - 775 sys sys 958526437 285
 rc/bin/eject - 775 sys sys 945617207 123
 rc/bin/fax - 775 sys sys 1015701359 2390
 rc/bin/fedex - 775 sys sys 1060187356 1244
-rc/bin/fshalt - 775 sys sys 1068425226 1092
+rc/bin/fshalt - 775 sys sys 1076458748 1315
 rc/bin/homespool - 775 sys sys 945617207 339
 rc/bin/ipconf - 20000000775 sys sys 1058791152 0
 rc/bin/ipconf/inside - 775 sys sys 1058790955 427

+ 1 - 0
dist/replica/plan9.log

@@ -13812,3 +13812,4 @@
 1076385677 5 c 386/bin/vac - 775 sys sys 1076385622 171944
 1076385677 6 c 386/bin/vacfs - 775 sys sys 1076385622 178117
 1076385677 7 c 386/lib/libcomplete.a - 664 sys sys 1076385623 6210
+1076459489 0 c rc/bin/fshalt - 775 sys sys 1076458748 1315

+ 32 - 21
rc/bin/fshalt

@@ -12,7 +12,7 @@ for(i in $f){
 	echo -n $i...
 	{
 		echo fsys all sync
-		if(! dial/expect -qt 120 ': ')
+		if(! dial/expect -t 120 ': ')
 			echo -n 'not synced...' > /dev/cons
 	} < $i >> $i
 }
@@ -39,27 +39,38 @@ cp /bin/echo /tmp
 cp /bin/disk/kfscmd /tmp
 cp /bin/rc /tmp
 cp /bin/sed /tmp
+cp /bin/ns /tmp
+cp /bin/iostats /tmp
+mkdir /tmp/lib
+cp /rc/lib/rcmain /tmp/lib
+bind /tmp /rc
 bind /tmp /bin
 
-echo
-echo -n halting...
-for(i in $f){
-	echo -n $i...
-	{
-		echo fsys all halt
-		if(! expect -qt 120 ': ')
-			echo -n 'not halted...' > /dev/cons
-	} < $i >> $i
-}
-
-for (i in $k){
-	echo -n $i... 
-	switch($i){
-	case /srv/kfs.cmd
-		kfscmd halt
-	case *
-		kfscmd -n `{echo $i | sed -n 's%/srv/kfs.(.*).cmd%\1%p'} halt
+# put this in a shell function so this rc script doesn't get read
+# when it's no longer accessible
+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){
+		case /srv/kfs.cmd
+			kfscmd halt
+		case *
+			kfscmd -n `{echo $i | sed -n 's%/srv/kfs.(.*).cmd%\1%p'} halt
+		}
 	}
+	echo
+	echo done
 }
-echo
-echo done
+
+x