[16:25:39]  woah i have underscores [16:26:10]  h_lfline_: you're loosing vowels rapidly [16:26:10]  anyway, noticed a typo [16:26:40]  if [ -f /etc/init/$base.conf ] [16:26:51]  should probably be /etc/event.d/$base.conf [16:27:04]  but i wonder if that's the most "upstarty" way to do it [16:27:17]  /etc/init is the 0.6.x path [16:27:21]  /etc/event.d is the 0.3.x path [16:27:26]  ohhhhhh [16:27:28]  makes sense [16:27:42]  h_lfline_: this should probably be in fedora-devel really. We've been coming down on the ubuntu questions pretty hard, so for fairness sake I should mention it. [16:27:59]  the problem is that if multiple DMs have installed jobs, you need to explicitly start one; you can't have them all start on a generic event [16:28:58]  but say you had a dm event [16:29:04]  with a DM variable [16:29:22]  then the only two competing would be the relevant dm and the fallback task [16:29:46]  sadmac2: oh i brought discussion here in case keybuk was around [16:30:24]  you guys probably know the internals of upstart a lot better than i do though [16:30:26]  h_lfline_: there is that. anyway its venturing into more generic upstart stuff anyway [16:30:51]  notting: so i wonder if we could have the fallback task sit back and wait [16:31:04]  and only chime in if the main event doesn't show up [16:31:40]  that sounds messy to code [16:32:14]  i'm looking at this state diagram that's in the upstart tree [16:32:34]  and it looks like things shoot to stopping if nothing is around [16:33:14]  so maybe we could have a handler on stopping that checks if runlevel is still 5 [16:33:27]  and if so starts fallback [16:34:13]  unless there's some upstart mechanism for "no one caught the event" [16:34:17]  h_lfline_: Is this absolutely necessary? [16:34:31]  no absolutely not [16:34:50]  just trying to come up with the most upstart-y way of doing things [16:35:10]  if doing [ -f /etc/init/$base.conf ] && start $base is the right way to go [16:35:14]  then that's fine with me [16:35:45]  backing up, the idea we're trying to solve [16:35:52]  we pick a $foo to start [16:36:11]  we want to start a specific provided-by-$foo job if it exists; if not, start a generic job that starts $foo [16:36:33]  hence the logic abov [16:37:19]  oh I see. hmm... [16:38:57]  notting: the way I'd do it would be to have the fallback job check if the provided-by-$foo job has already started, and if so, terminate itself. Then the special foo job should start on starting generic-job [16:39:01]  so the question is, do we detect if a job doesn't exist by doing if [ ! -f /etc/init.d/$job.conf ] or is there some upstart hook to say "only call me if for this event if no one else takes it" [16:39:43]  sadmac2: that would mean the fallback would need to know all possible names of provided-by-$foo. sounds painful [16:39:44]  sadmac2: is there a way to ensure job ordering? [16:40:35]  ohhh start on starting is the way you keep order [16:40:39]  notting: not really [16:41:16]  then you detect the presence of that (initctl list) to determine if the display manager is up [16:42:14]  thereby implementing a good chunk of upstart 1.0 in userspace in bash :) [16:42:46]  you mean "initctl status dm-started " [16:42:48]  ? [16:42:50]  sounds messy [16:44:30]  *one line in each of the specific jobs [16:45:09]  so you'd have specific job: 'start on start-dm DM=foo', and then 'post-start initctl emit started-dm' [16:45:31]  and the generic job has 'start on start-dm', 'stop on started-dm'. with a sleep thrown in? [16:45:32]  start on starting start-dm DM=foo [16:45:52]  notting: the specific job would have start on starting generic-dm-job DM=foo [16:45:59]  i think sadmac was saying if you put the "starting" then you don't need a sleep [16:46:13]  ***  plndra is now known as plundra. [16:46:27]  notting: the idea is we always just try to run the generic job, and then we just have the specific jobs jump in the way and say "wait!" [16:47:14]  'bar: start on starting foo' implies bar must finish before foo starts? [16:48:20]  when jobs emit events they wait for all the responders to finish responding before they continue. Its a very important part of how upstart works. [16:49:20]  * notting goes off to write the 'start on starting startup' job [16:49:36]  and then the generic job will never get past starting. [16:50:05]  oh that's a littler nicer [16:50:19]  so you have start on starting display-manager DM=gdm [16:50:37]  notting: that has the advantage that the generic job can be written in a vacuum, with no knowledge that there is such a thing as a specific job or that it might run instead. [16:50:37]  psot-start stop display-manager [16:50:43]  hmm that doesn't sound right [16:50:53]  maybe it should be called display-manager-arbiter or something [16:50:54]  h_lfline_: it doesn't but it is [16:51:03]  yeah, name it as you like [16:51:05]  so they don't need to know more than usual. [16:51:52]  lemme bounce you the mail [16:52:42]  by on my way home I mean about to grab my coat [16:52:50]  i have to head out in ~15 anyway [16:52:57]  cool [16:54:22]  clearly it should be called "quest-to-find-a-display-manager" [16:54:39]  start on starting quest-to-find-a-display-manager [16:54:46]  post-start stop quest-to-find-a-display-manager [16:54:59]  h_lfline_: of course, this is ignoring the contortions where it figures out what it needs to start. ah, legacy installbases and config files [16:55:44]  yea i'm pretty sure there's not much we can do about those checks and heuristics