Comment 2 for bug 690401

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

So, the current statd.conf makes sure that its always running when portmap is running with:

start on (started portmap or mounting TYPE=nfs)
stop on stopping portmap

It also makes sure, in case it was started on mounting TYPE=nfs before portmap, that portmap is running, in the pre-start.

portmap is

start on virtual-filesystems and net-device-up IFACE=lo

net-device-up IFACE=lo is special, and is emitted by network-interface, presumably before networking has even been started.

so portmap *may* be running too early.

What we really want to express is

"start statd after portmap, before mounting any nfs filesystems, after gaining write access to local filesystems". We *ALSO* need to express "stop statd before you stop portmap, and after you've started it during normal operation".

Anyway, I tried to have portmap export the current RUNLEVEL and do this:

start on (started portmap RUNLEVEL=[2345]) or (local-filesystems and mounting TYPE=nfs)

But I couldn't get exporting working at all, so I've done that check in the pre-star using UPSTART_EVENTSt, which actually seems to work, but I'm hesitant to present this as the final solution, as it feels rather hacky. Maybe somebody can figure out how to get portmap to export the current RUNLEVEL into its started event.

Also since we're not guaranteed to start with portmap or mounting, but nfs services also may need rpc.statd, I added start/stop on runlevel [2345].