summaryrefslogtreecommitdiff
path: root/fw/lib
diff options
context:
space:
mode:
Diffstat (limited to 'fw/lib')
-rwxr-xr-xfw/lib/fwstart20
1 files changed, 17 insertions, 3 deletions
diff --git a/fw/lib/fwstart b/fw/lib/fwstart
index 00b4d3a..ce89691 100755
--- a/fw/lib/fwstart
+++ b/fw/lib/fwstart
@@ -38,9 +38,23 @@ fn rulesfor {
' $cfg
}
-# each card gets its own control directory; mntgen makes them appear
+# Each card gets its own control directory; mntgen makes them appear.
+#
+# mount(2) needs the mount point to exist, so mntgen cannot make /mnt/fw
+# and this used to run it only when /mnt/fw was missing - which is the
+# one case where it fails. So the directory first, and then mntgen only
+# if it is not already there: under mntgen every name exists, which is
+# the test.
+#
+# mntgen and fw both leave a server behind, and a server started from a
+# shell keeps that shell's file descriptors. Started from the console -
+# or from a serial shell, which is where this gets tried first - that
+# means a daemon sitting on the console's input, which looks exactly
+# like a wedged terminal. Give them nothing to hold.
if(! test -d /mnt/fw)
- mntgen /mnt/fw
+ mkdir -p /mnt/fw
+if(! test -d /mnt/fw/is-mntgen-here)
+ mntgen /mnt/fw </dev/null >/dev/null >[2]/dev/null
for(name in `{cards}){
dev=/net/$name
@@ -52,7 +66,7 @@ for(name in `{cards}){
if not if(! test -f $rules)
echo fwstart: $rules missing, $name skipped >[1=2]
if not {
- fw -m /mnt/fw/$name -e $dev $rules
+ fw -m /mnt/fw/$name -e $dev $rules </dev/null >/dev/null
if(~ $status '')
echo fwstart: $name filtered by $rules
if not