Mounting partitions

Alex Smith alex at
Fri Mar 16 07:52:52 GMT 2007

Johan Kiviniemi wrote:
> Hi all,
> I wrote a bit of a braindump to my blag about how one might begin to
> implement the mounting of partitions with Upstart.
> The implementation has a piece of ugliness wrt. the computation of
> prerequisite mounts. Please share your ideas about how it might be
> handled better in Upstart – that is, how you'd expect it to work
> intuitively.

Well, currently you use a file to store the list of checked filesystems, 
/var/run/checked-filesystems. I think it would be better for Upstart to 
allow you to set variables inside it that you could store what would be 
in that file in, so if you did this in the fsck job:

initctl set checked-filesystems "$checked-filesystems $BLOCKDEV"

It would append $BLOCKDEV to the checked-filesystems variable, and the 
value of the checked-filesystems variable would be available in the 
environment of any other job, so rather that reading a file you can 
simply check $checked-filesystems. Of course, the disadvantage here is 
that if, although unlikely, Upstart segfaults, then it'll most likely 
loose that variable so mounting wouldn't work properly.

Wrt. working out prerequisite mounts, it would probably be nice to 
integrate that functionality into getmntent, so rather than having that 
loop, you could do something like

getmntent --prerequisites /home

Alex Smith
Frugalware Linux developer -

More information about the upstart-devel mailing list