Comment 4 for bug 643289

Revision history for this message
Alexander Achenbach (xela) wrote :

Suitable for the mountall async patch set just provided, here is my set of job configuration files for nfs-common:

gssd -- (triggered by portmap and local-filesystems)
gssd-mounting -- (triggered by mounting, triggers gssd)
idmapd -- (triggered by local-filesystems)
idmapd-mounting -- (triggered by mounting, triggers idmapd)
statd -- (triggered by portmap and local-filesystems)
statd-mounting -- (triggered by mounting, triggers statd)
rpc_pipefs -- (not triggered directly)
rpc_pipefs-wait -- (triggers rpc_pipefs; starting this allows to trigger/wait for rpc_pipefs)

You may find their job configuration files in the attached tarball.

The *-mounting jobs are meant to exclusively deal with individual emissions of mounting events by mountall. They are multi-instance jobs to make concurrent mounts independent.

The rpc_pipefs-wait job is similar (wrt rpc_pipefs) to portmap-wait (wrt portmap). It is needed since more than one daemon (idmapd, gssd) may have to wait for rpc_pipefs, and the previous multi-instance approach in rpc_pipefs (as of 2.20+nmu1) was unreliable (races between eg idmapd starting / rpc_pipefs mounting and [unneeded] gssd stopping / rpc_pipefs unmounting).

Since there is a large amount of script re-use in most of the above, I moved testers for gssd/idmapd/statd applicability into their own script (/usr/share/nfs-common/functions). This script is also included in the attached tarball.

I originally intended to have 'start on local-filesystems and mounting ...' in the corresponding *-mounting.conf files. Unfortunately, this does not work reliably with upstart. Generally, the whole state machine of upstart seems to be rather fragile or inconsistent with regard to handling of multiple events. So instead, I made an attempt to create a stateful form of the local-filesystems event. The following two jobs are meant for it and should probably go into the mountall package:

mountall-local -- (represents persistent state after local-filesystems, ie local file systems are up)
mountall-local-wait -- (starting this allows to wait for the state of local file systems being up)

The two job configuration files for these are also included in the tarball.

Most of these jobs are just kludges for missing or unreliable functionality in upstart, but they worked fine for our needs. I hope they may prove useful until upstart provides better ways to deal with things.