Small improvement for make-fai-nfsroot

Christopher Huhn C.Huhn at gsi.de
Tue Dec 22 15:53:31 CET 2009


Hi FAIarians,

I had small problems with make-fai-nfsroot and hooks: the script tried
to run backup files (*~) as well as subdirectories beneath my
$NFSROOT_HOOKS and failed on the first error because of running with
"set -e". This is not the behavior I intended.

My quick hack solution is to delegate running hook scripts to run-parts
(from the debianutils package). So only executable files matching a
given pattern will be executed. The only drawback (?) is that scripts
run in a separate process, so environment variables they use must be
exported (in my case that's only $NFSROOT and $NFSROOT_HOOKS).

@@ -465,9 +448,10 @@
     fi
     if [ -d "$NFSROOT_HOOKS"  ]; then
         echo "Running hooks..."
-        for file in $(ls $NFSROOT_HOOKS/* 2>/dev/null); do
-            . $file
-        done
+
+        export NFSROOT NFSROOT_HOOKS
+        run-parts --verbose --regex "^[[:alnum:]_.-]+$" $NFSROOT_HOOKS
+
     fi
 }
 # - - - - - - - - - - - - - - - - - - - - - - - - - -

Happy holidays/Frohes Fest,
    Christopher

P.S.: "New partition tool setup-storage
<http://www.informatik.uni-koeln.de/fai/doc/man/fai-setup.html> added"
on the FAI homepage links to the man page of fai-setup. I suspect it
should be the setup-storage man page instead.


-- 
Christopher Huhn
Linux therapist

GSI Helmholtzzentrum für Schwerionenforschung GmbH
Planckstraße 1
D-64291 Darmstadt
www.gsi.de

Registered Office: Darmstadt, Commercial Register: Darmstadt, HRB 1528

Managing Directors: Professor Dr. Dr. h.c. Horst Stoecker, Christiane Neumann

Supervisory Board Chair: Dr. Beatrix Vierkorn-Rudolph
Deputy Chair: Ministerialdirigent Dr. Rolf Bernhardt



More information about the linux-fai mailing list