summaryrefslogtreecommitdiff
path: root/rc
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2018-11-27 22:37:32 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2018-11-27 22:37:32 +0100
commit22b28520cd431c2f68acd66b877122379d704914 (patch)
treefd1fb3733361ed8d7bb4dfd46b0dfa6a3bb0649a /rc
parent243c25fd8f397ff37c1ad597524cccd23db46d1c (diff)
fshalt: wait for fileservers command file to vanish
cwfs and hjfs create ther /srv command files with ORCLOSE flag, so they get removed once the fileserver terminates. we can use this to check that the fileserver has in fact finished halting without making assumtions about the time it should maximally take for any fileserver to write out its buffers to disk.
Diffstat (limited to 'rc')
-rwxr-xr-xrc/bin/fshalt14
1 files changed, 6 insertions, 8 deletions
diff --git a/rc/bin/fshalt b/rc/bin/fshalt
index 2fed2465a..24ee921c4 100755
--- a/rc/bin/fshalt
+++ b/rc/bin/fshalt
@@ -45,6 +45,7 @@ cp /bin/rc /tmp
cp /bin/sed /tmp
cp /bin/sleep /tmp
cp /bin/scram /tmp
+cp /bin/test /tmp
bind /tmp /rc
bind /tmp /bin
@@ -53,15 +54,12 @@ bind /tmp /bin
fn x {
echo
echo -n halting...
- for (i in $c){
- echo -n $i...
- echo halt >>$i
- sleep 2
- }
- for(i in $h){
- echo -n $i
+ for (i in $c $h)
echo halt >>$i
- sleep 2
+ for (i in $c $h){
+ echo -n $i...
+ while(test -e $i)
+ sleep 1
}
echo
echo done halting