/srv/irclogs.ubuntu.com/2010/01/19/#upstart.txt

=== robbiew is now known as robbiew_
=== btm_ is now known as btm
=== rberger_ is now known as rberger
=== robbiew_ is now known as robbiew
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> remove16:58
tj___is there something similar for upstart or do i just need to remove the conf file under /etc/init ?16:59
sadmac2tj___: nothing similar as of yet17:01
tj___ok17:01
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 g17:07
tj___this worked fine until karmic but now that more services are using upstart, i need to figure out another way to do that17:07
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 disabled17:09
sadmac2remove g?17:10
tj___g?17:17
sadmac2" it'll check for this boot argument and if exists, it'll remove g"17:18
tj___ah that was clipped17: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-nbd17:19
sadmac2tj___: you have some strange ways of operating17:20
tj___could be but it works^Hed :)17:21
mbiebltj___: just comment out the "start on" in the upstart job files18:55
=== rberger_ is now known as rberger
keesjHI19:58
keesjHow or when does upstart connect to the dbus-daemon system bus?19:59
keesjis this something I can configure?19:59
keesjI 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 daemon20:00
sadmac2keesj: 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:03
keesjI would find it somewhat strange if upstart would not start the daemon itself and on my ubuntu machine. it starts dbus-daemon itself20:06
keesjbut I think I found the trick..20:06
keesjpost-start exec kill -USR1 120:06
sadmac2keesj: exactly20:06
keesjin the dbus.conf will probably make upsart try again20:06
sadmac2sounds right20:07
sadmac2though I wonder why ubuntu doesn't have that already if it was put it.20:07
sadmac2*in20:07
keesji ubuntu it is20:08
keesjhttp://paste-it.net/public/x881ffb/20:08
keesjit just lacks a comment why I did that :p20:10
sadmac2perfect then20:11
keesjthanks for helping20:15
h_lfline_notting: hey so i'm looking at your prefdm.conf / gdm.conf stuff21:25
h_lfline_woah i have underscores21:25
sadmac2h_lfline_: you're loosing vowels rapidly21:26
h_lfline_anyway, noticed a typo21:26
h_lfline_if [ -f /etc/init/$base.conf ]21:26
h_lfline_should probably be /etc/event.d/$base.conf21:26
h_lfline_but i wonder if that's the most "upstarty" way to do it21:27
notting/etc/init is the 0.6.x path21:27
notting/etc/event.d is the 0.3.x path21:27
h_lfline_ohhhhhh21:27
h_lfline_makes sense21:27
sadmac2h_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
nottingthe 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 event21:27
h_lfline_but say you had a dm event21:28
h_lfline_with a DM variable21:29
h_lfline_then the only two competing would be the relevant dm and the fallback task21:29
h_lfline_sadmac2: oh i brought discussion here in case keybuk was around21:29
h_lfline_you guys probably know the internals of upstart  a lot better than i do though21:30
sadmac2h_lfline_: there is that. anyway its venturing into more generic upstart stuff anyway21:30
h_lfline_notting: so i wonder if we could have the fallback task sit back and wait21:30
h_lfline_and only chime in if the main event doesn't show up21:31
nottingthat sounds messy to code21:31
h_lfline_i'm looking at this state diagram that's in the upstart tree21:32
h_lfline_and it looks like things shoot to stopping if nothing is around 21:32
h_lfline_so maybe we could have a handler on stopping that checks if runlevel is still 521:33
h_lfline_and if so starts fallback21:33
h_lfline_unless there's some upstart mechanism for "no one caught the event"21:34
sadmac2h_lfline_: Is this absolutely necessary?21:34
h_lfline_no absolutely not21:34
h_lfline_just trying to come up with the most upstart-y way of doing things21:34
h_lfline_if doing [ -f /etc/init/$base.conf ] && start $base is the right way to go21:35
h_lfline_then that's fine with me21:35
nottingbacking up, the idea we're trying to solve21:35
nottingwe pick a $foo to start21:35
nottingwe want to start a specific provided-by-$foo job if it exists; if not, start a generic job that starts $foo21:36
nottinghence the logic abov21:36
sadmac2oh I see. hmm...21:37
sadmac2notting: 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-job21:38
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
nottingsadmac2: that would mean the fallback would need to know all possible names of provided-by-$foo. sounds painful21:39
h_lfline_sadmac2: is there a way to ensure job ordering?21:39
h_lfline_ohhh start on starting is the way you keep order21:40
sadmac2notting: not really21:40
nottingsadmac2: how do you know what to check for otherwise?21:41
sadmac2notting: 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 will21:41
sadmac2notting: then you detect the presence of that (initctl list) to determine if the display manager is up21:42
sadmac2notting: 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
nottingsounds messy21:42
sadmac2notting: its one line in each of the generic jobs ( post-start start dm-started ) and really not much in the generic job21:44
sadmac2*one line in each of the specific jobs21:44
nottingso you'd have specific job: 'start on start-dm DM=foo', and then 'post-start initctl emit started-dm'21:45
nottingand 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=foo21:45
sadmac2notting: the specific job would have start on starting generic-dm-job DM=foo21:45
h_lfline_i think sadmac was saying if you put the "starting" then you don't need a sleep21:45
=== plndra is now known as plundra
sadmac2notting: 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:46
notting'bar: start on starting foo' implies bar must finish before foo starts?21:47
sadmac2notting: yes.21:48
sadmac2notting: 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:48
* notting goes off to write the 'start on starting startup' job21:49
sadmac2notting: 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
sadmac2notting: and then the generic job will never get past starting.21:49
h_lfline_oh that's a littler nicer21:50
h_lfline_so you have start on starting display-manager DM=gdm21:50
sadmac2notting: 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-manager21:50
h_lfline_hmm that doesn't sound right21:50
h_lfline_maybe it should be called display-manager-arbiter or something21:50
sadmac2h_lfline_: it doesn't but it is21:50
sadmac2h_lfline_: yeah, name it as you like21:51
nottingsadmac2: although it does mean that the individual jobs need to know about the generic job21:51
sadmac2notting: indeed, but they'd have to know about some event or something that was going to kick them off anyway.21:51
sadmac2notting: so they don't need to know more than usual.21:51
nottingsadmac2: not as written now, but as halfline says, it's a bit hackish21:51
sadmac2notting: I'm on my way home. I could stop by and look at what you have21:52
nottinglemme bounce you the mail21:52
sadmac2by on my way home I mean about to grab my coat21:52
nottingi have to head out in ~15 anyway21:52
sadmac2cool21:52
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-manager21:54
h_lfline_post-start stop quest-to-find-a-display-manager21:54
nottingh_lfline_: of course, this is ignoring the contortions where it figures out what it needs to start. ah, legacy installbases and config files21:54
h_lfline_yea i'm pretty sure there's not much we can do about those checks and heuristics21:55
keesjhow about an all-display-manager-rise 22:32

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!