Instead of 'return 1', these should be 'stop; exit 1' - otherwise, the 'respawn' will cause upstart to repeatedly try to launch the daemon even though it's guaranteed to fail.
+ exec /usr/sbin/automount $OPTIONS
I guess this $OPTIONS variable is meant to be taken from /etc/default/autofs, but there's nothing in the job that makes this variable to the 'exec' - sourcing it in the pre-start script only makes it available to the pre-start script.
Either the unused $OPTIONS should be dropped, or this should be rewritten as:
script
if [ -f /etc/default/autofs ]; then
. /etc/default/autofs
fi
exec /usr/sbin/automount $OPTIONS
end script
+pre-script
Wrong; this is "pre-start script".
+ echo "Error: failed to load autofs4 module."
+ return 1
+ # wrong autofs filesystem module loaded
+ echo
+ echo "Error: autofs kernel module is loaded, autofs4 required"
+ return 1
Instead of 'return 1', these should be 'stop; exit 1' - otherwise, the 'respawn' will cause upstart to repeatedly try to launch the daemon even though it's guaranteed to fail.
+ exec /usr/sbin/automount $OPTIONS
I guess this $OPTIONS variable is meant to be taken from /etc/default/ autofs, but there's nothing in the job that makes this variable to the 'exec' - sourcing it in the pre-start script only makes it available to the pre-start script.
Either the unused $OPTIONS should be dropped, or this should be rewritten as:
script
if [ -f /etc/default/autofs ]; then
. /etc/default/autofs
fi
exec /usr/sbin/automount $OPTIONS
end script