[REVIEW] New man page summarising Upstart events
Scott James Remnant
scott at netsplit.com
Fri Jan 14 09:55:04 UTC 2011
Hi James, thanks for sending this to the list.
On Tue, Jan 11, 2011 at 9:24 PM, James Hunt <james.hunt at canonical.com> wrote:
> My thoughts:
>
> 1) Display Manager
>
> - - If we move to a new DM, can we continue to offer these events?
> - - We don't appear to provide the specified events for kdm (kubuntu).
> Is this an oversight?
> - - /etc/init/gdm.conf shows "emits starting-dm" which appears to be
> erroneous as it doesn't emit this. Fix is a quick tweak to
> /etc/init/gdm.conf I suspect.
> - - I think we may be missing a trick wrt the "desktop-session-start"
> event. If we tweak /etc/gdm/PreSession/Default changing the last
> line from...
>
Yeah, as I mentioned on the video call the other day, I put these
events in at the last minute because I thought they might be useful
but never got around to using them. If they're documented, we should
ensure that all of the DMs provide them.
> /sbin/initctl -q emit desktop-session-start DISPLAY_MANAGER=gdm
>
> ...to:
>
> /sbin/initctl -q emit desktop-session-start DISPLAY_MANAGER=gdm \
> USER=$USER USERNAME=$USERNAME LOGNAME=$LOGNAME
>
> we get the ability to create jobs that depend on particular users
> logging in! :-)
>
This makes sense.
I have a vague memory that you can just state "initctl emit ... USER
USERNAME LOGNAME" to get the current values of those environment
variables, but test that first ;-)
> 2) Missing man pages
>
> I believe the rows in the Event column in the first table that are not
> in bold denote a comprehensive(?) list of missing upstart-ish man pages.
> If so, I'll hack some together for the Natty release.
>
> Note: This man page may need to be revised for Natty as we are
> considering introducing some "abstract jobs" to avoid the need to
> hard-code specific application names into .conf files. This was
> mentioned on as alluded to by Clint on this list recently [1].
>
net-device-added, net-device-removed are both emitted by
upstart-udev-bridge, as are any events of the form <KERNEL
SUBSYSTEM>-device-<ACTION>ed
So there's graphics-device-added/removed, tty-device-added/removed,
etc. See /sys/class for the possible values
net-device-up/down are emitted by scripts in /etc/network/if-up.d and
if-down.d respectively.
It's probably worth documenting whether events are waited for or not
by the emitter, since that determines whether they are a signal, hook
or method pattern. I'd probably use those names, since they're terms
I'm trying to promulgate to aid understanding.
Scott
More information about the upstart-devel
mailing list