When does "start on path-mounted" work?

Asked by ErikShreve on 2010-09-01

I've written a script (see below), trying to use a "start on path-mounted" stanza. However, it doesn't seem to run when mountall-net.conf mounts the path (I'm running Ubuntu 10.04) or when I mount the path from the command line. What am I doing wrong?

# backuppc - Start the backuppc daemon
#

description "BackupPC Deamon"
author "Erik Shreve"

start on path-mounted /media/backuppc
stop on runlevel [!2345]

expect fork

#console output

pre-start script
 if [ ! -d /var/run/backuppc ]; then
     mkdir /var/run/backuppc
     chown backuppc:backuppc /var/run/backuppc
 fi

end script

script
 exec su backuppc -c "exec /usr/share/backuppc/bin/BackupPC -d"
end script

Question information

Language:
English Edit question
Status:
Solved
For:
upstart Edit question
Assignee:
No assignee Edit question
Solved by:
ErikShreve
Solved:
2010-09-02
Last query:
2010-09-02
Last reply:
ErikShreve (eshreve) said : #1

In Ubuntu 10.04, the mountall command (which is a sort of helper to upstart) apparently emits "mounted" not "path-mounted" with a parameter called MOUNTPOINT.

Thus, using the following in the script I posted above works for running the script during boot:

start on mounted MOUNTPOINT=/media/backuppc

This doesn't appear to work for manually mounting the path. However, working during boot is good enough for me. Thus, I'm marking the item as solved.