shithub: 9ferno

Download patch

ref: 5c1809afc89f0fc73f5a9b6b3251a846765c2a20
parent: 4f8e1cef8a662f5a85f82f99fa54f5af3431945a
author: 9ferno <gophone2015@gmail.com>
date: Wed Sep 1 11:00:58 EDT 2021

shutdown kfs64 using halt

--- a/dis/shutdown	Wed Sep  1 11:04:17 2021
+++ b/dis/shutdown	Wed Sep  1 11:00:58 2021
@@ -6,26 +6,24 @@
 	exit usage
 }
 cd /
-# the following is a bit pointless until kfs has halt
-#	but, the sync will atleast write out all the dirty blocks
+
+ns | grep '/n/rootdisk/dis /dis' &&
+       unmount /n/rootdisk/dis /dis
+unmount /n/rootdisk /
+unmount /n/rootdisk
+
 ftest -f /dis/disk/kfscmd.dis && {
 	for(a in /chan/kfs.*.cmd){
 		b=${hd ${tl ${split '.' $a}}}
 		~ $"b '\*' || {
-			disk/kfscmd -n $b sync # halt
+			disk/kfscmd -n $b sync # though there is no write buffering yet
+			disk/kfscmd -n $b halt # only works for disk/kfs64
 		}
 	}
 }
-
-# need a better way of doing this - this is dumb
-#	there is no way to clean up all the mounts and binds
-ns | grep '/n/rootdisk/dis /dis' &&
-	unmount /n/rootdisk/dis /dis
-unmount /n/rootdisk /
-unmount /n/rootdisk
 status=()
-ns
 
+ns
 if {~ $1 -r} {
 	echo reboot >/dev/sysctl
 } {~ $1 -h} {