[16:58] <tj___> hi.. a question about temporarily disabling services managed by upstart from starting.. let's say i'd like to disable some service for a reason or another but don't want to uninstall the package. in debian/ubuntu, with traditional init scripts, you could disable a service from starting on boot by running update-rc.d -f <service> remove
[16:59] <tj___> is there something similar for upstart or do i just need to remove the conf file under /etc/init ?
[17:01] <sadmac2> tj___: nothing similar as of yet
[17:01] <tj___> ok
[17:07] <tj___> i have an ltsp server setup with local apps. handy for trying out machines, testing motherboards etc. quickly without having local disks. by default it'll boot to desktop. but in the pxe menu i've setup an entry for a quick non-graphical boot with minimum services running. it passes a special command line option to kernel. then i have a custom boot script which is run very early in the boot process. it'll check for this boot argument and if exists, it'll remove g
[17:07] <tj___> this worked fine until karmic but now that more services are using upstart, i need to figure out another way to do that
[17:09] <tj___> i'd rather not just remove the conf file for the service as it would be handy if you could manually start any service after the boot if needed, only autostart on boot should be disabled
[17:10] <sadmac2> remove g?
[17:17] <tj___> g?
[17:18] <sadmac2> " it'll check for this boot argument and if exists, it'll remove g"
[17:19] <tj___> ah that was clipped
[17:19] <tj___> it'll remove gdm and other desktop related services using update-rc.d from the root fs which is unionfs-on-top-of-squashfs-mounted-over-nbd
[17:20] <sadmac2> tj___: you have some strange ways of operating
[17:21] <tj___> could be but it works^Hed :)
[18:55] <mbiebl> tj___: just comment out the "start on" in the upstart job files
[19:58] <keesj> HI
[19:59] <keesj> How or when does upstart connect to the dbus-daemon system bus?
[19:59] <keesj> is this something I can configure?
[20:00] <keesj> I am mainly interested in talking to upstart from a user accont and possibly using the dbus-daemon 's system configuration to configure who can access the upstart daemon
[20:03] <sadmac2> keesj: it used to connect when launched, which meant if you ran it before dbus (i.e. the way you'd always run it in a non-test environment) it would never connect. I think something was done about this but I'm not sure.
[20:06] <keesj> I would find it somewhat strange if upstart would not start the daemon itself and on my ubuntu machine. it starts dbus-daemon itself
[20:06] <keesj> but I think I found the trick..
[20:06] <keesj> post-start exec kill -USR1 1
[20:06] <sadmac2> keesj: exactly
[20:06] <keesj> in the dbus.conf will probably make upsart try again
[20:07] <sadmac2> sounds right
[20:07] <sadmac2> though I wonder why ubuntu doesn't have that already if it was put it.
[20:07] <sadmac2> *in
[20:08] <keesj> i ubuntu it is
[20:08] <keesj> http://paste-it.net/public/x881ffb/
[20:10] <keesj> it just lacks a comment why I did that :p
[20:11] <sadmac2> perfect then
[20:15] <keesj> thanks for helping
[21:25] <h_lfline_> notting: hey so i'm looking at your prefdm.conf / gdm.conf stuff
[21:25] <h_lfline_> woah i have underscores
[21:26] <sadmac2> h_lfline_: you're loosing vowels rapidly
[21:26] <h_lfline_> anyway, noticed a typo
[21:26] <h_lfline_> if [ -f /etc/init/$base.conf ]
[21:26] <h_lfline_> should probably be /etc/event.d/$base.conf
[21:27] <h_lfline_> but i wonder if that's the most "upstarty" way to do it
[21:27] <notting> /etc/init is the 0.6.x path
[21:27] <notting> /etc/event.d is the 0.3.x path
[21:27] <h_lfline_> ohhhhhh
[21:27] <h_lfline_> makes sense
[21:27] <sadmac2> 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.
[21:27] <notting> 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
[21:28] <h_lfline_> but say you had a dm event
[21:29] <h_lfline_> with a DM variable
[21:29] <h_lfline_> then the only two competing would be the relevant dm and the fallback task
[21:29] <h_lfline_> sadmac2: oh i brought discussion here in case keybuk was around
[21:30] <h_lfline_> you guys probably know the internals of upstart  a lot better than i do though
[21:30] <sadmac2> h_lfline_: there is that. anyway its venturing into more generic upstart stuff anyway
[21:30] <h_lfline_> notting: so i wonder if we could have the fallback task sit back and wait
[21:31] <h_lfline_> and only chime in if the main event doesn't show up
[21:31] <notting> that sounds messy to code
[21:32] <h_lfline_> i'm looking at this state diagram that's in the upstart tree
[21:32] <h_lfline_> and it looks like things shoot to stopping if nothing is around 
[21:33] <h_lfline_> so maybe we could have a handler on stopping that checks if runlevel is still 5
[21:33] <h_lfline_> and if so starts fallback
[21:34] <h_lfline_> unless there's some upstart mechanism for "no one caught the event"
[21:34] <sadmac2> h_lfline_: Is this absolutely necessary?
[21:34] <h_lfline_> no absolutely not
[21:34] <h_lfline_> just trying to come up with the most upstart-y way of doing things
[21:35] <h_lfline_> if doing [ -f /etc/init/$base.conf ] && start $base is the right way to go
[21:35] <h_lfline_> then that's fine with me
[21:35] <notting> backing up, the idea we're trying to solve
[21:35] <notting> we pick a $foo to start
[21:36] <notting> we want to start a specific provided-by-$foo job if it exists; if not, start a generic job that starts $foo
[21:36] <notting> hence the logic abov
[21:37] <sadmac2> oh I see. hmm...
[21:38] <sadmac2> 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
[21:39] <h_lfline_> 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"
[21:39] <notting> sadmac2: that would mean the fallback would need to know all possible names of provided-by-$foo. sounds painful
[21:39] <h_lfline_> sadmac2: is there a way to ensure job ordering?
[21:40] <h_lfline_> ohhh start on starting is the way you keep order
[21:40] <sadmac2> notting: not really
[21:41] <notting> sadmac2: how do you know what to check for otherwise?
[21:41] <sadmac2> notting: what you would do is have all of the provided-by-$foo jobs start another job called dm-started DISPLAY=$whatever. That job would have no executable. Its a "state" if you will
[21:42] <sadmac2> notting: then you detect the presence of that (initctl list) to determine if the display manager is up
[21:42] <sadmac2> notting: thereby implementing a good chunk of upstart 1.0 in userspace in bash :)
[21:42] <h_lfline_> you mean "initctl status dm-started "
[21:42] <h_lfline_> ?
[21:42] <notting> sounds messy
[21:44] <sadmac2> notting: its one line in each of the generic jobs ( post-start start dm-started ) and really not much in the generic job
[21:44] <sadmac2> *one line in each of the specific jobs
[21:45] <notting> so you'd have specific job: 'start on start-dm DM=foo', and then 'post-start initctl emit started-dm'
[21:45] <notting> and the generic job has 'start on start-dm', 'stop on started-dm'. with a sleep thrown in?
[21:45] <h_lfline_> start on starting start-dm DM=foo
[21:45] <sadmac2> notting: the specific job would have start on starting generic-dm-job DM=foo
[21:45] <h_lfline_> i think sadmac was saying if you put the "starting" then you don't need a sleep
[21:46] <sadmac2> 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!"
[21:47] <notting> 'bar: start on starting foo' implies bar must finish before foo starts?
[21:48] <sadmac2> notting: yes.
[21:48] <sadmac2> notting: 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.
[21:49]  * notting goes off to write the 'start on starting startup' job
[21:49] <sadmac2> notting: and actually you don't need the dm-started state. you could have the specific jobs just have "post-start stop generic-job"
[21:49] <sadmac2> notting: and then the generic job will never get past starting.
[21:50] <h_lfline_> oh that's a littler nicer
[21:50] <h_lfline_> so you have start on starting display-manager DM=gdm
[21:50] <sadmac2> 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.
[21:50] <h_lfline_> psot-start stop display-manager
[21:50] <h_lfline_> hmm that doesn't sound right
[21:50] <h_lfline_> maybe it should be called display-manager-arbiter or something
[21:50] <sadmac2> h_lfline_: it doesn't but it is
[21:51] <sadmac2> h_lfline_: yeah, name it as you like
[21:51] <notting> sadmac2: although it does mean that the individual jobs need to know about the generic job
[21:51] <sadmac2> notting: indeed, but they'd have to know about some event or something that was going to kick them off anyway.
[21:51] <sadmac2> notting: so they don't need to know more than usual.
[21:51] <notting> sadmac2: not as written now, but as halfline says, it's a bit hackish
[21:52] <sadmac2> notting: I'm on my way home. I could stop by and look at what you have
[21:52] <notting> lemme bounce you the mail
[21:52] <sadmac2> by on my way home I mean about to grab my coat
[21:52] <notting> i have to head out in ~15 anyway
[21:52] <sadmac2> cool
[21:54] <h_lfline_> clearly it should be called "quest-to-find-a-display-manager"
[21:54] <h_lfline_> start on starting quest-to-find-a-display-manager
[21:54] <h_lfline_> post-start stop quest-to-find-a-display-manager
[21:54] <notting> h_lfline_: of course, this is ignoring the contortions where it figures out what it needs to start. ah, legacy installbases and config files
[21:55] <h_lfline_> yea i'm pretty sure there's not much we can do about those checks and heuristics
[22:32] <keesj> how about an all-display-manager-rise