On Wed, 2010-02-24 at 11:50 -0600, Patrick Goetz wrote:

> And probably way to busy to work on documentation.  At some point it 
> would be nice to have a better understanding of how upstart works.  The 
> concept of an event driven init replacement isn't completely jelling in 
> my little peanut brain; even more so as a replacement for cron/anacron.
> 
> For example, in /etc/init/networking.conf one finds
> 
> start on (local-filesystems
>            and stopped udevtrigger)
> 
> Hookay, but what/where is "local-filesystems"?  I can't find a conf file 
> for this in /etc/init, although there is one for udevtrigger.
> 
Anyone can emit any event.  That's probably the bit of Upstart that
people find the hardest to get to grips with, so there can never be any
comprehensive list of every event and every argument - because anyone
can add a new one.

However there are "recommendations".


First is that if the service a job represents emits an event, it uses
the (purely documentation) "emits" stanza in its job file.  That way you
can get a rough idea by parsing /etc/init/*.conf

    $ grep "emits local-filesystems" /etc/init/*.conf
    /etc/init/mountall.conf:emits local-filesystems

So local-filesystems comes from the mountall service.


Second is that the service actually documents the event in the form of a
manpage (this was missing in karmic, but added in lucid).  So

    $ man 7 local-filesystems

    DESCRIPTION
       The local-filesystems event is  generated  by  the  moun‐
       tall(8) daemon after it has mounted all local filesystems
       listed in fstab(5).  mountall(8) emits this event  as  an
       informational  signal,  services  and  tasks  started  or
       stopped by this event will do so in parallel  with  other
       activity.

       This  event  is  typically  used by services that must be
       started in order for remote filesystems, if  any,  to  be
       activated.   Remember that some users may not consider it
       wrong to place /usr on a  remote  filesystem.   For  most
       normal services the filesystem(7) event is sufficient.

       This  event  will never occur before the virtual-filesys‐
       tems(7) event.

    EXAMPLE
       A service that wishes to be running once  local  filesys‐
       tems are mounted might use:

              start on local-filesystems


> Right now in Lucid things are a bit of a mess, with a bunch of stuff in 
> /etc/init and a bunch of other very similar stuff in /etc/init.d.  Not a 
> problem of course if everything just works flawlessly right out of the 
> box so that I don't even have to think about it, but.....  <:)
> 
That's because all this is still in development.

I've asked nicely to spend the next cycle "finishing" Upstart :-)

Scott
-- 
Scott James Remnant
sc...@ubuntu.com

Attachment: signature.asc
Description: This is a digitally signed message part

-- 
Ubuntu-devel-discuss mailing list
Ubuntu-devel-discuss@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-devel-discuss

Reply via email to