summaryrefslogtreecommitdiff
path: root/rc
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@localhost>2011-07-21 15:59:54 +0200
committercinap_lenrek <cinap_lenrek@localhost>2011-07-21 15:59:54 +0200
commit3202d39042623467db4bf51cb583e191f3aa54d2 (patch)
treee8a00b1676c4df9d6340eeca6f17e4fa5e5c2957 /rc
parent474bc6a14ae55f5b4def8dad3370d9f0a81a7d7e (diff)
parent43f327485d374db949b9d83816c186371bbe4420 (diff)
downloadplan9front-3202d39042623467db4bf51cb583e191f3aa54d2.tar.xz
merge
Diffstat (limited to 'rc')
-rwxr-xr-xrc/bin/fshalt11
1 files changed, 9 insertions, 2 deletions
diff --git a/rc/bin/fshalt b/rc/bin/fshalt
index 867276c2d..c6bf8c854 100755
--- a/rc/bin/fshalt
+++ b/rc/bin/fshalt
@@ -3,6 +3,7 @@
# and optionally reboot
rfork e
reboot=no
+scram=no
switch ($#*) {
case 0
case 1
@@ -14,6 +15,8 @@ case *
path=(/bin)
builtin cd /
+bind -c '#s' /srv
+bind '#p' /proc
unmount /mnt/consoles >[2]/dev/null
kill consolefs | rc # don't compete with /mnt/consoles
@@ -33,8 +36,11 @@ for (i in $k){
sleep 2
}
-# for scram
+# for scram, don't scram other systems
bind -b '#P' /dev
+if (test -e '#P'/apm)
+ if (! ~ $reboot yes)
+ scram=yes
# halting (binaries we run can't be on the fs we're halting)
ramfs
@@ -79,7 +85,8 @@ fn x {
echo rebooting...
echo reboot >'#c/reboot'
}
- if not scram
+ if (~ $scram yes)
+ scram
}
x