Code review comment for lp:~clint-fewbar/ubuntu/natty/nfs-utils/wait-for-local-filesystems

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Sorry, the runlevel check is used to avoid starting with portmap outside those runlevels. Essentially, portmap starts way too early, but we do need to start after it, and restart whenever portmap is restarted.

I think it would be MUCH more clear if we could say

start on started portmap RUNLEVEL=[2345] ...

But I can't seem to get portmap to export a RUNLEVEL in its started event. For that matter, I can't seem to get any jobs to export a variable, so I'm a little confused as to how to do it.

As far as the shell prefix removal, it works fine for me, though it may not be clear what is going on because we're testing in runlevel 2:

$ RLEVEL=`runlevel`
$ RLEVEL=${RLEVEL#? [016]}
$ echo $RLEVEL
N 2
$
$ RLEVEL=`runlevel`
$ RLEVEL=${RLEVEL#? [2345]}
$ echo $RLEVEL

$

The idea is that it will be empty when [2345] are there. Hence

if [ "x$RLEVEL" != x ] ; then
  # handle the != runlevel [2345] stuff

I don't know if awk will be available, given that it is in /usr, which is allowed to be on NFS. But maybe there's a minimal awk available during boot, or something else that will allow a more clear scriptlet?

« Back to merge proposal