#upstart 2006-10-09
<Rapadura> Hello People, UpStart Works on the Slackware?
<Keybuk> it should do
[jenda(n=jenda@ubuntu/member/jenda)]  help
#upstart 2006-10-10
<maro_> Keybuk: regarding the script syntax, have you considered using a make-like syntax instead?
<thom> oh please no
<Keybuk> maro_: I think I share thom's response here ;)
<Keybuk> DEPENDENCIES := foo
<Keybuk> DEPENDENCIES += bar
<Keybuk> start::
<Keybuk>    some script
<thom> i couldn't imagine anything more hideous, personally. but you could have some fun
<Keybuk> .EXEC: /sbin/some --daemon
<Keybuk> actually, that'd be illegal, you'd need \t before "some script" :)
<Keybuk> thom: X. M. L.
<thom> vpath %.event \ /etc/event.d/ ; %.event: ...
<thom> Keybuk: true
<maro_> Keybuk: no, that wasn't what I meant :)
<maro_> it was only for the "start script"/"end script" stanza
<Keybuk> maro_: elaborate
<maro_> I was initially confused with the "start script" wording since I thought it meant "start of script" (versus "before running the command")
<maro_> Keybuk: http://borkware.net/~mark/upstart-service.txt
<maro_> (refresh)
<Keybuk> the trouble there is the requirement for indentation and physical tabs
<maro_> python fans will love it, though ;)
<maro_> my guess is that most distros/users will be consistent in their indentation anyway, and enforcing it will make 3rd party supplied event scripts more consistent
<maro_> anyway, that's just my POV, you're the code monkey :)
<maro_> btw, the 'while' thing is mainly to avoid "start on this-up", "stop on this-down"
<_ion> I'm not very fond of the pythonish way of indentation.
<thom> can we please not have a pointless indentation debate
<maro_> yeah :)
<thom> the problem with make like indentation is that some poor user will always cock it up and then get really, _really_ confused
<maro_> my main liking about it is that it's more human/language-friendly to use a colon, and it saves a line for each script - screw the indentation :)
<maro_> (the only argument I can see for that is that the people who edit event scripts are likely to already be familiar with make syntax)
<thom> maro_: i don't think that's particularly likely; think about the poor sysadmin who needs to knock up an event script quickly
<maro_> what about the poor sysadmin that though "start script" was the syntax for beginning any script block since it's stopped with "end script"? (e.g. me ;))
<Keybuk> there's a more interesting problem that "start script" implies the script should start the daemon
<maro_> anyway, screw the make syntax part, what do you think about "while"/"when"?
<Keybuk> it's planned to be renamed to pre-start and post-start anyway, which should make things clearer
<maro_> Keybuk: true :)
<Keybuk> while/when ?
<maro_> Keybuk: the first non-commented line in the file
<maro_> also allowing "functions" to be either script blocks or binaries ("run" in that file)
<Keybuk> "while X is Y" doesn't make sense ... events are one-shot occurrences
<maro_> Keybuk: hal would run "while dbus is running"
<maro_> i.e. respawn if it dies, and stop when dbus is no longer running
<Keybuk> what is "dbus" in this context?
<maro_> system bus is available :)
<Keybuk> but what is that?
<Keybuk> it's not an event
<maro_> the start/stop of it is, but yeah, point taken
<Keybuk> start on job-started dbus
<Keybuk> stop on job-stopped dbus
<Keybuk> start on job-failed self
<Keybuk> accomplishes much the same thing
<Keybuk> though not quite, interestingly
<maro_> and which one is nicer to read/understand? :)
<Keybuk> maro_: I'd say yours is easier to read, but mine is easier to understand
<maro_> I really like the "start on job-failed self" thing instead of exec/respawn :)
<x4NothinKx> hi
<x4NothinKx> is mahangu there?
<maro_> how does "when storage is added" look like?
<maro_> "on storage-added"?
<Keybuk> define "added"
<Keybuk> you have block-device-added, or path-mounted, etc.
<Keybuk> depending what you name those events
<maro_> that's set by the storage event (and could be anything)
<maro_> are all those files in /etc/event.d? :/
<_ion> Huh?
<Keybuk> no, those are events
<maro_> ah, right, "arbitrary strings" - I need coffee :)
<x4NothinKx> could someone tell me when mahangu is regular in the channel?
<Keybuk> also see https://wiki.ubuntu.com/UpstartDesignChanges
<Keybuk> that details where we're thinking of going with them
<x4NothinKx> i want to do the documentation and german translation for upstart
<maro_> looking at it, thanks :)
<Keybuk> x4NothinKx: https://launchpad.net/products/upstart/main/+pots/upstart/de/+translate
<maro_> Keybuk: btw, I noticed that initctl list doesn't remove moved files
<maro_> (in current upstart, obviously)
<maro_> s/moved/re&/
<Keybuk> right
<Keybuk> known bug
<maro_> ok, as long as it's considered a bug :)
<Keybuk> or moved files, actually ;)
<maro_> or both :)
<Keybuk> yup, it's actually just a lack of implementation
<Keybuk> e.g. should a job be stopped if you remove its file? :)
<maro_> hmm, good question
<maro_> I'll avoid thinking about that, might get a headache
<_ion> IMO definitely yes (unless it's only renamed)
<maro_> _ion: in which case... should it be restarted?
<_ion> I don't see a reason to restart it.
<maro_> nah, true, initctl should just list the new name
<_ion> Just change the job's name in memory.
<Keybuk> they're not restarted when modified
<Keybuk> so in theory they probably shouldn't be when renamed
<_ion> Yep.
<maro_> agree completely
<maro_> I'd hate to upgrade initscripts if they were ;)
<maro_> Keybuk: I also get a ton of hal noise on my console even when using "console null" - I guess hal's helpers are to blame?
<Keybuk> yes
<maro_> heh, hal just had pid 666, wonder why
<_ion> Because it's an integer between 2 and kernel.pid_max
<Artanicus> heh
<x4NothinKx> i do the translation now
<x4NothinKx> but i think rosetta is not good
<x4NothinKx> its very difficult to find matching vocabulary
<x4NothinKx> because the most words are without a context
<x4NothinKx> thats a puzzle
<Keybuk> I'm afraid I know little about translation, or the difficulty involved
<x4NothinKx> some words should be kept in german, like "killed" or so. But some should'nt. I need to test the translation intensively.
#upstart 2006-10-11
* Keybuk makes bzr upstart build again
<jams> any idea when the website will return?
<jams> oops wrong channel
#upstart 2006-10-12
<Keybuk> mbiebl: did my bug reply make sense, btw?
<mbiebl> Yes, I used the pristine tarball.
<Keybuk> yeah, I decided that having logd parse /proc/cmdline was ill-advised
<Keybuk> and once I worked that out, your behaviour was obvious
<Keybuk> in the "no initrd, but quiet on command-line" variant, it couldn't read /proc/cmdline on start, so failed to chatty
<mbiebl> You said, it's already fixed in the bzr branch?
<Keybuk> yeah
<Keybuk> I backed it out of bzr at the same time I backed it out of the ubuntu package
<mbiebl> Maybe I'll give it a try then today ;-)
<mbiebl> See if it works
<mbiebl> Do you schedule the 0.3 release after edgy?
<Keybuk> haven't got a planned release time for 0.3.0 yet
<Keybuk> probably before edgy releases
<Keybuk> but it won't go into edgy
* Keybuk has yet to decide what 0.3.0 will include
<Keybuk> I had planned that it would use new IPC code
<Keybuk> but I'm tempted to release it earlier with just the new libnih
<_ion> Perhaps the file deletion patch could be included without the "disabled stanza" part?
<Keybuk> _ion: I wasn't completely convinced by the implementation of that patch
<Keybuk> I had meant to chat to you about it, but that got lost somewhere in the fog of my brain :)
<Keybuk> looking at it again, I think it was just the disabled stuff that looked wrong
<Keybuk> (in particular, where the code was -- it made more sense to check for disabled only when entering the JOB_RUNNING state, then multiple checks elsewhere)
<_ion> Another idea i had was creating one more goal, JOB_DELETE, and the state JOB_DELETING and let job_change_state handle the deletion completely. I haven't taken a look at the code recently, but i think that would remove the need for checks all over the place.
<_ion> Would that make sense?
<Keybuk> it may make sense, I'm not sure yet
<Keybuk> I haven't fully understood the changes we've talked about to the state system yet
#upstart 2006-10-13
<GarBage> /etc/rc.local is not run, why?
<johnnybuoy> anyone running mysql-server on edgy?
<johnnybuoy> I'm wondering if what I get is an ustart bug...
<johnnybuoy> anyone running mysql-server on edgy?
<johnnybuoy> I'm wondering if what I get is an ustart bug...
#upstart 2006-10-14
<dantje> Hi, the example-jobs.tar.gz in getting-started.html is broken.
<dantje> i.e. the goes nowhere
#upstart 2007-10-08
<Keybuk> hmm, momentary thoughts on bug tracking
<Keybuk> is "logd not working" a bug?
<Keybuk> or is it simply wishlist
<Jc2k> is it a regression?
<Jc2k> if it never worked, its a wishlist IMO
<Keybuk> it worked once, then we disabled it
<Keybuk> the reason I wonder is that the "triaged" state doesn't make sense for it
<Jc2k> urrrgh
<Keybuk> (or some of the other bugs in there)
<Keybuk> Confirmed - there's enough information to replicate the bu
<Keybuk> Triaged - there's enough information to fix the bug
<Keybuk> but for things like that, neither makes sense
<Keybuk> which is why I wonder whether it's a wishlist
<Jc2k> its a regression so in one sense its a bug. but its not really fatal to anything so more of a wishlist item..
<Keybuk> yeah, tricky innit
<Jc2k> aye
<Jc2k> toss a coin?
<Jc2k> heads its a wishlist
<Jc2k> ;)
<Jc2k> had any more upstart related thoughtlets?
<Keybuk> not yet
<Jc2k> im not sure what to do for my needs :(
<Keybuk> what were those again?
<Jc2k> one example is for syncing windows mobile devices
<Jc2k> synce.org has a couple of daemon type progs it needs
<Jc2k> i dont really like the idea of them running constantly
<Jc2k> so wanted to try using hal events to start them
<Jc2k> i had been thinking hal -> upstart
<Jc2k> on top of that, there are quite a few devices that need you to ppp them before they are useful. network manager could be used for that in the future, but i dont know how far off such things are...
<Keybuk> ah yes, I remember
<Keybuk> months off, at least
<Jc2k> ideally i'd like to have this stuff auto-magicked by then
<Jc2k> i think the guy i was talking to on ubuntu-devel-discuss was hoping to have something pretty for HH...
<Keybuk> oh, who was that?
<Jc2k> i think Martin Owens
<Jc2k> we had cultural differences between yorkshire and liverpool..
<Jc2k> :)
<Keybuk> the sync project stuff?
<Jc2k> aye
<Keybuk> yeah, there's a few people working on that for 8.04
<Jc2k> nice that they are getting in touch...
<Keybuk> how do you mean?
<Jc2k> i've not heard anything from martin or anyone else and theres been no mention of it on ubuntu dd
<Keybuk> wouldn't be yet
<Keybuk> we're still in the 7.10 release cycle
<Jc2k> ahh
<Keybuk> 8.04 doesn't begin for another couple of weeks
<Jc2k> i know that theres a RH guy really interested in Conduit, so i was hoping to get a bit of cross-distro love
<Jc2k> but i really want some flashy "here i am plugging in my phone and it just working" demo before i go pimping again! :)
<Keybuk> the trouble with cross-distro love is that the distros don't tend to love each other ;)
<Jc2k> aye :(
<Jc2k> i'll love the distro that loves me i guess
<Jc2k> unfortunately there arent any local (at least inside UK) get togethers i know of in the near term where I can pimp Conduit and/or get help with the fiddly polishy bits needed to support some of the devices we want to support
<Jc2k> i think the nearest is going to be, ironic as its so far, linux conf au
<Jc2k> or lug radio us
* Jc2k is still angry he missed guadec
<Jc2k> Keybuk: think i'm going to resort to "pupstart" unless you have any ideas.
<Jc2k> i.e. a subset of upstart in python solely focused on my simple needs
<Keybuk> init can't be written in Python
<Keybuk> you'll end up with a machine full of zombie processes, and a non-functioning init :p
<Keybuk> (not without rewriting the C bits of Python, anyway)
<Jc2k> eh
<Jc2k> it wouldnt be init
<Keybuk> what would it be then?
<Jc2k> some event -> start a program, some event -> stop a program
<Jc2k> primarily hal events
<Keybuk> if it's not an init daemon, please don't call it "upstart" or anything even similar
<Jc2k> and able to deal with multiple copies of same programs
<Keybuk> otherwise that will just confuse people
<Jc2k> ok
<Keybuk> you already have that though -- it's called D-BUS :p
<Jc2k> eh
<Jc2k> really?
<Keybuk> that does most of it already
<Jc2k> do i have to add dbus to everything though
<Keybuk> probably
<Keybuk> this is not a bad thing
<Jc2k> alas a bit much for my weak C skills
<Jc2k> might be doable for the synce case though
<ion_> Perhaps gutsy just contains too old versions of opensync and conduit, but i dont seem to be able to sync two evolutions over the network using either one. :-\
* Keybuk hasn't tried that yet
<Keybuk>    conduit |    0.3.2-1 | http://gb.archive.ubuntu.com gutsy/universe Packages
<Jc2k> i wet myself when i made the video.
<Keybuk>   opensync | 0.19-1.2ubuntu1 | http://gb.archive.ubuntu.com gutsy/main Sources
<ion_> (d be nice if conduit and opensync were integrated somehow, btw.)
<Jc2k> its *really* sweet
<Jc2k> conduit is up to 0.3.4
<Jc2k> the network sync hasn't been released, you need to run svn
<Jc2k> opensync, 0.19 is ancient.
<Jc2k> ion_: i'm working to let opensync be used from conduit
<ion_> Nice
<Keybuk> nothing newer in Debian
<Jc2k> atm i am able to use opensync plugins in conduit
<Jc2k> and hoping to support multiple sync engines soon too
<Jc2k> meant to be going to germany to collaborate with them soon
<Jc2k> anyway, if there are any conduit questions im happy to answer on #conduit (GIMPnet), but back on topic
<Jc2k> doing this all in dbus has implications on the scope of upstart?
<Jc2k> e.g. equally some of boot up (sh/w)ould be handled by the dbus system activation patches?
<Keybuk> yes
<Keybuk> in a 100% new-world desktop, the only init supervised services would be udev/hal, d-bus and gdm
<Keybuk> (though that ignores things like mounting filesystems, etc. - but then RH have a single shell script for all that)
<Jc2k> what about crashes
<Jc2k> should some of these dbus triggered services self-heal or just wait to be needed
<Keybuk> who knows
<Jc2k> :)
<Keybuk> this is why Upstart development has stalled for a while
<Keybuk> figuring out how it fits in
<Jc2k> the thing i still dont understand in the new-world desktop is how services die.
<Jc2k> i want things to go away..
<Keybuk> I think we have to consider D-BUS signals a key part of the system
<Keybuk> which means that they need to be able to start and stop processes on their own
<Keybuk> it makes sense to have a ServiceManager daemon that handles this
<Keybuk> which makes room for Upstart
<Keybuk> (it then makes sense for D-BUS and HAL to use that ServiceManager for their own activation purposes)
<Keybuk> the difficulty comes in two stages:
<Keybuk>  1) how are D-BUS signals captured, and converted into useful environment for the service being started
<Keybuk>  2) what about events that aren't D-BUS signals yet?
<Jc2k> it depends on what information will be needed for (2), but from the outsider position wrapper seems doable to inject faux dbus signals
<Keybuk> the annoying thing is how hard D-BUS signals are to define
<Jc2k> aye
<Jc2k> perhaps the hal path, key, value approach would work?
<Jc2k> the signal would always be a path, key and value
<Jc2k> or perhaps a list of
<Keybuk> The DpmsModeChanged signal in the org.gnome.PowerManager interface emitted from the /org/gnome/PowerManager object by the org.gnome.PowerManager service
* Jc2k grumbles at dbus
<Jc2k> i was thinking we'd be able to control all the signals, but of course we might want to respond to other signals
<Keybuk> (and that's for objects you can name!  You can't reliably name objects from HAL!)
<Jc2k> so artificially restricting the kinds of signals that are interesting is not possible...
<Keybuk> yeah
<Jc2k> is dbus introspectable enough from C land that we could have a FDI-alike?
<Keybuk> yes
<Keybuk> but then we're in FDI hell
<Jc2k> with great power comes great pains in the butt
<Keybuk> and sometimes a signal is just a signal
<Keybuk> and contains no useful information
<Keybuk> you need to make an object call to obtain the information about the signal
<Jc2k> and at this point we have a desire for a minimal scripting language
<Jc2k> and the equal opposite desire for fear of the untold danger involved in such a thing
<Keybuk> so you can see why this needs careful thought :p
<Jc2k> indeed.
<Jc2k> hopefully pestering you will help you decide whats best ;)
<Keybuk> heh
<Keybuk> I haven't had time to sit down and understand D-BUS
<Keybuk> and more particularly, how it's used
<Keybuk> if I had a list of the signals, methods, etc. that all the usual desktop bits generated, then I would have a better idea
<Keybuk> since that would infer what to listen for
<Jc2k> eh
<Jc2k> i've tried to understand it
<Jc2k> and i hurted :P
<Jc2k> the current case seems to be that the initial uses of dbus were a bit crap and not how the API was intended to be used
<Jc2k> but that this is improving
<Keybuk> yeah
<Keybuk> but they won't drop them :p
<Jc2k> :p
<Jc2k> i had an idea
<Jc2k> then i tried to replay it in my head
<Jc2k> and forgot the best bit
<Jc2k> -_-
<Jc2k> i hate jet lag
<AlexExtreme> <Keybuk> 15:17:12> +init can't be written in Python
<AlexExtreme> <Keybuk> 15:17:25> +you'll end up with a machine full of zombie processes, and a non-functioning init :p
<AlexExtreme> ^^ pardus wrote their init in python ;)
<Jc2k> AlexExtreme: i knew there was one distro that did, forgot its name.. thx
<Jc2k> wait
<AlexExtreme> although, it's rather buggy :P
<Jc2k> AlexExtreme: have i seen you in #ylug or #lugradio at all?
<AlexExtreme> I don't think so
<AlexExtreme> at least, I don't remember ever being in either of those
<Jc2k> hmmm
<Jc2k> its going to bother me now :)
<Keybuk> AlexExtreme: heh
<Keybuk> the Python problem is that it doesn't handle signals properly
<Keybuk> it handles them well enough for user space
<Keybuk> but init has different signal semantics
<AlexExtreme> yes
* Jc2k tries to remember his idea
<Jc2k> i was thinking along the lines of mapping the entire boot sequence and saying which things belonged to dbus activation and which things still need init and any other categories along the way
<Jc2k> i was also thinking that this whole stalemate is because of the big picture
<Jc2k> trying to make sure upstart is ready for everything, without even knowing what everything is
<Jc2k> on the python thing
<Jc2k> could init be chained?
<Jc2k> as in, the actual init just starts a python init which is then "orginary"
<Jc2k> perhaps the "raw" upstart has the service start/stop api
<Jc2k> e.g. org.something.ServiceManager
<Jc2k> and then python pokes the other services
<Keybuk> the python init is still not ordinary
<Keybuk> since it's still pid #1
<Jc2k> eh
<Keybuk> unless the python process was forked
<Keybuk> in which case, you lose the special powers you get as pid #1
<Keybuk> which are the reason to be pid #1 in the first place
<Jc2k> i was going for making the special powers to be dbus exposed
<Keybuk> splitting Upstart into a ServiceManager component and a ServiceActivator component has been discussed
<Keybuk> the thought was that /sbin/init would be pid #1
<Keybuk> and would expose the org.freedesktop.ServiceManager interface
<Keybuk> and then you'd start other things that used that interface to start and stop processes
<Keybuk> though it's not clear how you handle blocking in that scenario
<Keybuk> (where when you start apache, it blocks waiting for other services to start first)
<Jc2k> and presumably in that case the ServiceActivator is "normal"?
<Jc2k> dont really grok the apache case. are you saying that apache shouldnt start until other things are ready, or that other things shouldnt start until apache is ready?
<Keybuk> both
<Amaranth> Jc2k: Both
<Amaranth> heh
<Keybuk> if you've got tomcat installed, it should be started if apache is starting
<Keybuk> and apache should wait until tomcat is started before continuing
<Jc2k> how is that handled in the current case? the init script doesnt exit until apache is ready?
<Jc2k> sorry for nub questions btw
<Keybuk> current case?
<Jc2k> as in, why does moving to ServiceManager  ServiceActivator make this different?
<Jc2k> presumably ServiceManager can just issue a signal when a process is loaded?
<Jc2k> kind of like Twisted has Defer's
<Keybuk> but then ServiceManager has to block :)
<Keybuk> ie. when does it decide to carry on
<Jc2k> when the signal fires?
<Jc2k> i imagine it would be painful in C land, but twisted python is pretty good at pausing where its at until a signal completes
<Keybuk> but D-BUS has no notion of signal completion
<Keybuk> it'd actually need to be a method
<Keybuk> which is somewhat kooky, since who is the method against?
<Amaranth> or fire a 'finished' signal
<Jc2k> maybe "completes" was a bad choice
<Jc2k> i call StartProcess and then attach to a signal called ProcessStarted
<Jc2k> also dbus does have a way to specify a function to call when the method completes
<Jc2k> so you can StartProcess(some, params, reply_handler=self.Started_Cb)
<Jc2k> where self is an object containing enough info to carry on
<Keybuk> err?
<Keybuk> sorry, not following
<Jc2k> 1s
<Jc2k> Keybuk: http://pastebin.com/d80f7e06 <- make any sense?
<Jc2k> aside from the fact that its not even close to valid python...
<Amaranth> it's pretty close :)
<Jc2k> Amaranth: i puked when i re-read it.
<Keybuk> Jc2k: the problem is, how does the StupidManager send out the message that the job is starting
<Keybuk> and thereby give other processes the option to handle that message, and delay the starting of the job
<Amaranth> oh, uh, ouch
<Jc2k> Keybuk: i guess that such delays should be handled before you go to ServiceManager
<Jc2k> ?
<Jc2k> actually no
<Jc2k> so theres a difference between the Apache job and the apache process?
<Keybuk> dunno
<Jc2k> you start ./apache and ./tomcot before  the apache "job" is ready
<Jc2k> *tomcat even
* Jc2k abuses ./ for visual clarity rather than noobness
<Jc2k> Keybuk: are you going to be near IRC tonight?
<Keybuk> yeah probably
<Jc2k> okies
<Jc2k> i have to commute for a bit now, so i'll think about another version of my pastebin 
<Jc2k> it will treat a job as something different from a process
<Jc2k> which i think is the key to it satisfy your needs
<Keybuk> interesting
<Keybuk> so GNOME Power Manager is entirely implemented through HAL D-BUS stuff
<Keybuk> signal sender=:1.10 -> dest=(null destination) path=/org/freedesktop/PowerManagement; interface=org.freedesktop.PowerManagement; member=OnBatteryChanged
<Keybuk>    boolean false
<Keybuk> actually, sorry, that's wrong
<Keybuk> since that's not coming from HAL
<Keybuk> even though the docs say it will
* Keybuk frowns
<Keybuk> GNOME developers should be banned from uploading anything without docs
<Keybuk> (says the author of the most undocumented init system there is :p)
<ion_> :-)
<Keybuk> though I'm making some kind of process
<Keybuk> e.g. "running while a battery is present"
<Keybuk> => listen to HAL for DeviceAdded/DeviceRemoved signals, take the object path and then check for the "battery" capability, it has it, check the "battery.present" property is "true"
<Keybuk> (also obviously listen for changes to that property, as well as the NewCapability signal in case some existing object becomes a battery)
<Keybuk> so this requires a combination of method calls and signals
<Keybuk> this strongly implies the need for upstart-addon-hal
<Keybuk> likewise similar for avahi
<Keybuk> since for that you need a ServiceBrowser for each thing you want to watch for
* Jc2k is back home at last
<Jc2k> Keybuk: still not grokking the big problem
<Keybuk> it's quite complex to explain :-/
<Jc2k> tell me about it
<Jc2k> i feel like im missing something obvious
<Jc2k> before upstart i implemented an event based job manager for my old company
<Jc2k> events were simpler there
<Jc2k> timer events, file change events and "job x finished" events
<Jc2k> each job was dependant on multiple events
<Jc2k> and then i had a set of god awful queries to work out which jobs were due to run
<Keybuk> right
<Jc2k> that could handle all kinds of edge cases
<Keybuk> it's the god awful bit that causes us issues
<Jc2k> well in my case, the god awful came from having to build it out of ms access and vbscript :P
<Keybuk> heh
<Keybuk> ok, let me try and quickly explain
<Keybuk> jobs can be manually or automatically started and stopped
<Keybuk> manual is by initctl, automatic is by events
<Keybuk> jobs also generate events themselves
<Keybuk> four of them
<Keybuk>  starting = I'm about to start, but nothing has been run yet
<Keybuk>  started = I'm now running and ready for action
<Keybuk>  stopping = I'm about to stop, but nothing has been killed yet
<Keybuk>  stopped = I'm no longer running
<Keybuk> thus the events that jobs can be automatically started/stopped by aren't just external forces like battery status, but can also be based on other jobs
<Keybuk> so if HAL depends on D-BUS, it can be started by the "started dbus" event and stopped by the "stopping dbus" event
<Keybuk> that way HAL is never running when d-bus isn't
<Jc2k> grokking so far
<Keybuk> events in Upstart have the notion of completion
<Keybuk> initctl emit foo will actually wait until that event emission has completed
<Keybuk> the completion of an event is when all jobs that reacted to it have reached their goal state
<Keybuk> (running for services, stopped again for tasks)
<Keybuk> so if I have a service that's started "on foo", "initctl emit foo" will actually show the progress of that service, and not return until that service is running
<Keybuk> this means events also have failure
<Keybuk> if that service fails to start, initctl emit foo will actually exit 1
<Keybuk> (if no services are affected by the event, the event completes immediately)
<Keybuk> ok?
<Jc2k> grokking :)
<Jc2k> good so far
<Keybuk> right
<Keybuk> so upstart uses this event completion internally for the starting and stopping job events
<Keybuk> when the service emits the starting event, it will not proceed until the starting event has completed
<Keybuk> likewise for the stopping event
<Keybuk> so if I have a small task that's run "on stopping mysql" (e.g. to backup the database), mysql *will not be stopped* until that task completes
<Keybuk> since services only need to reach running or stopped, this also provides upstart's dependency mechanism
<Jc2k> so even though mysqld isnt running, the mysql "job" is still "stopping"
<Keybuk> no
<Keybuk> mysqld *IS* running
<Keybuk> upstart hasn't killed it yet
<Jc2k> ahh
<Jc2k> ok
<Keybuk> (or it might not be, if mysqld died, but that's a different story :p)
<Jc2k> lol
<Keybuk> the event does actually tell you why mysql is stopping
<Keybuk> on stopping mysql failed main
<Keybuk>   EXIT_SIGNAL=SEGV
<Keybuk> for example
<Keybuk> anyway, digressing
<Keybuk> since services only need to reach running or stopping, this provides Upstart's dependency system
<Keybuk> the tomcat server, if installed, is a dependency of Apache
<Keybuk> (web sites use it)
<Keybuk> so the tomcat job can specify:
<Keybuk>   start on starting apache
<Keybuk>   stop on stopped apache
<Keybuk> now, if you "start apache" the following will happen:
<Keybuk> the apache job emits the starting apache event
<Keybuk> which starts the tomcat job (event is now blocked)
<Keybuk> the tomcat job issues starting tomcat, runs its various scripts, and eventually the tomcat daemon is running
<Keybuk> tomcat job emits started tomcat
<Keybuk> and the event is now unblocked
<Keybuk> and thus the event completes
<Keybuk> apache can now start, run its various scripts, and the httpd daemon
<Keybuk> so the tomcat job, by being started when apache is starting (rather than started) can make itself a dependency of apache
<Keybuk> (and rather usefully, it becomes tied to the lifecyle of apache - you don't have to think of it as a separate service)
<Jc2k> got it
<Jc2k> so with start on starting apache we make sure tomcat starts before apache
<Keybuk> exactly
<Jc2k> so i cant actually do my python demo without mixing in dependencies
<Keybuk> this is the bit that's hard to implement with a separated service manager and automation manager core
<Keybuk> since the service manager needs to be able to block the service on things that the automation manager knows
<Jc2k> i still think i can do it with async dbus
<Jc2k> though i worry i missed something
<Keybuk> the problem with dbus is that you need to specify someone to ask :)
<Keybuk> signals have no completion
<Keybuk> so the starting/stopping events can't be signals
<Keybuk> (we'd never know whether something cared)
<Keybuk> they have to be methods
<Keybuk> and you can't have an open method
<Keybuk> you have to know who you're asking
<Keybuk> at which point, why have two processes since they're inherently coupled anyway?
<Jc2k> are we saying that the problem is that when ServiceManager raises a signal you no longer know what that signal is about?
<Keybuk> no
<Keybuk> that it doesn't know whether anyone cared about the signal
<Keybuk> or whether those who cared about the signal did anything about it
<Jc2k> this is the bit where i dont get it :)
<Jc2k> im ok up to where i said "i worry i missed something"
<Jc2k> then my world fell apart
<Keybuk> heh
<Keybuk> which bit don't you get?
<Keybuk> you understand how Upstart events work wrt completion?>
<Jc2k> apache is starting, but tomcat has to start first, so tomcat starts. apache is still in the starting state until tomcat is started.. then apache finishes starting and it is started...
<Jc2k> all that stuff makes sense
<Keybuk> right
<Jc2k> i dont understand how it breaks down when the service is split in 2
<Jc2k> i dont understand what is lost
<Keybuk> the way that events work :)
<Keybuk> because D-BUS doesn't support that at all
<Jc2k> i see that it doesnt support that natively
<Keybuk> exactly
<Keybuk> you can't use signals to do it
<Keybuk> you have to use methods
<Keybuk> does that make sense?
<Jc2k> but most of the state should be in the automation manager..
<Jc2k> if i can prototype it, you buy me beer?
<Keybuk> :)
<Keybuk> sure
<Keybuk> does it make sense that you can't use D-BUS signals?
<Keybuk> because they are fire-and-forget
<Jc2k> kind of
<Jc2k> im going to try to use async method calls first
<Keybuk> so the problem with method calls is that, in D-BUS, you must know your target
<Keybuk> I can't tell the world that a job is starting
<Keybuk> I can only tell one person
<Keybuk> (I can tell the world with signals, but I cannot find out whether the world cared)
<Keybuk> with a method, I can tell one person, and they can give me a result
<Keybuk> but I have to hard-code that one person
<Jc2k> right
<Jc2k> now i understand.
<Jc2k> and i scratch my freshly shaved beard.
<Jc2k> but...
<Keybuk> so since the service manager would have the name of the policy bit hard-coded
<Keybuk> why have them separate at all? :p
<Jc2k> no.
<Jc2k> brain failing... holding on to thread of something...
<Jc2k> i think we are talking about different services
<Jc2k> in my mind i was assuming that pid 1 *soley* starts and stops single processes
<Jc2k> but in actual fact
<Jc2k> pid 1 starts and stops jobs
<Jc2k> which is why the dependency stuff comes in and starts being awkward
<Jc2k> in my mind i was thinking that was in pid 2 or wherever, hence why i didnt grok that there would be a problem
<Jc2k> so essentially dbus sucks because you can ask it to do something, it can poke you and tell you something happened but it can't poke you and ask you a question
<Jc2k> Keybuk: did that make sense?
<Keybuk> yup that makes sense
<Keybuk> I don't think you need to separate processes and jobs?
<Jc2k> no, i just misunderstood a key point :P
<Jc2k> i still have an idea, but i want to have a play with it first.
<Keybuk> ok
<Jc2k> the basic idea is to flip it around and have things that are interested in events expose an interface of their own
<Jc2k> so signal Announce from org,frestuff,EventListener at /org/freestuff/EventListener/<some_uid>
<Jc2k> that interface would allow events to block
<Jc2k> but though it works
<Jc2k> its still messy
<Jc2k> hmm
* Jc2k abandons quest for free beer
#upstart 2007-10-09
<macogw> oh awesome this channel *does* exist
<macogw> does this channel fall under the category of "support channel" or "dev channel"?  i'm having issues with my bootup time and using bootchart to figure out where it's getting hung
<bill__> hello
<bill__> i need a hand with upstart on ubuntu under openvz
<bill__> lo md
#upstart 2007-10-10
* Starting logfile irclogs/upstart.log
<ion_> http://xkcd.com/327/
* Starting logfile irclogs/upstart.log
#upstart 2007-10-11
<dspstv> hi all
<dspstv> im on this machine that has ubuntu
<dspstv> so no inittab is present
<dspstv> and i just need to add one line to put a program to respawn if it crahses
<dspstv> i've read and google has mislead me since yesterday
<dspstv> now, someone from the ubuntu channel told me to ask in here
<dspstv> in inittab it will be just adding one line...
<dspstv> im lost
<Keybuk> inittab isn't used in Ubuntu
<Keybuk> what would you like to do?
<dspstv> Keybuk, yes that i figured
<dspstv> i just need to add a line
<dspstv> for a program
<dspstv> i need to keep alive
<dspstv> so, respawn was my friend
<Keybuk> what line would you have added?
<dspstv> let me see..
<dspstv> i have to copy any and just change the service for the program i want
<dspstv> need to just know where one does that in upstart
<dspstv> please
<dspstv> i have a software for music called pd
<dspstv> i need to treat it as a deamon
<dspstv> i have done that in other distros
<Keybuk> you're not helping yourself here
<dspstv> sure
<dspstv> i can agree
<dspstv> im not a pro on this
<Keybuk> if you give me the details you enter into inittab, I can tell you what you need to do for upstart
<dspstv> ok
<Keybuk> e.g. what command is it that you need to run, etc.?
<Keybuk> does that command go into the background when you run it?
<dspstv> this is what i had used
<dspstv> null:12345:respawn:/bin/pd -nogui -verbose -nomidi
<dspstv> null:12345:respawn:/bin/pd
<Keybuk> ok
<Keybuk> so in Upstart parlance, you'd need a file in /etc/event.d containing
<Keybuk> respawn
<Keybuk> exec /bin/pd -nogui -verbose -nomidi
<Keybuk> -- 
<Keybuk> that requires manual starting, see the tty1 file for how to make it start and stop in certain runlevels
<dspstv> Keybuk, the name of that file requieres a special naming structure?
<dspstv> Keybuk, tx!
<Keybuk> dspstv: no, name can be whatever you like
<dspstv> man tx again
<dspstv> i take note now
<j_> hi
<Jc2k> hi
<j_> hi
<Jc2k> hi
<j_> I'm looking for an upstart maintainer
<Jc2k> if you ask a q and idle someone will get back to u
<j_> I'd like to known when it's schedule to add the "and" condition in upstart
<Keybuk> j_: it's already added on bzr trunk, but has interestingly unexpected issue
<j_> could you be more specific?
<Keybuk> well, take a simple example
<Keybuk> start on foo and bar
<Keybuk> stop on frodo or bilbo
<Keybuk> -- 
<Keybuk> foo happens, job remains stopped
<Keybuk> bar happens, job starts
<Keybuk> frodo happens, job sttops
<Keybuk> --
<Keybuk> now, do foo *and* bar both need to happen again?
<Keybuk> or is it enough that either happens?
* ..[topic/#upstart:Keybuk] : Upstart 0.3.8 | http://upstart.ubuntu.com/ | http://people.ubuntu.com/~fabbione/irclogs/ | https://lists.ubuntu.com/archives/upstart-devel/2007-October/000468.html
<Jc2k> Keybuk: eh, in my scheduler i was lucky in that i could say *both* always needed to happen again :D
<Jc2k> re the two seperate upstart services idea, i think you would have a chance at doing it by exposing an interface from the manager back the job handler (pid 1)
<j_> I think that it will stop
<Jc2k> but it would get messy
<Keybuk> j_: remain stopped?
<Keybuk> so if frodo or bilbo happen, the job needs both foo and bar to happen again?
<j_> no
<Keybuk> no?  what happens once a job stops then?
<Keybuk> which events can restart it?
<j_> not necessarlely
<j_> you may need to a once condition
<j_> like that
<Keybuk> ?
<j_> start_once on  foo and bar 
<Keybuk> ?
<j_> stop on  frodo or bilbo
<j_> respan on  foo or bar
<Keybuk> that makes it insanely complicated ;)
<j_> You're right
<Keybuk> since then upstart would need to track whether a job has been run once or not :)
<j_> I think that the problem is to known what do to respam it
<Keybuk> in practice I think that consistency is better than flexibility
<Keybuk> since it's easier to document consistent behaviour
<Keybuk> and consistent behaviour has emergent properties
<Keybuk> the problem I hit was I implemented it to both events had to happen again
<Keybuk> once a job was in stop/waiting, it "forgot" what had started it
<Keybuk> the problem was that this worked fine
<Keybuk> except when the events happened while the job was still stopping
<Keybuk> in which case either one would start it again
<Keybuk> so you ended up with a curious situation where the behaviour depended on how quick you were
<Keybuk> the worst kind of race condition
<Keybuk> so I realised that the event expression has to be evaluated
<Keybuk> but then instantly forgotten the moment it's true
<Keybuk> instead somehow transferring the result of that into the job
<Keybuk> not as easy as it appeared
<j_> could it be possible to add a "schedule work" and a lock of the events when you have a stop event
<Keybuk> j_: sorry, I don't follow
<j_> that will fix the problem, when you have a stop , if a new event arrive it will be handle after the stop not a the same time
<Jc2k> ahh
<Jc2k> a queue
<j_> yes
<Jc2k> j_: is that what you meant?
<Jc2k> ahh
<Jc2k> too slow
<Jc2k> :P
<j_> just when you have a stop condition and only for its events
<j_> it will append not every time
<Keybuk> or make the expression indempotent
<Keybuk> so once evaluation has finished, it can safely be evaluated again immediately
<j_> what did you if a stop takes 1 minutes
<j_> ?
<Keybuk> it'd be restarted at the end of it
<Keybuk> since the goal would be start, so on leaving the post-stop state, it'd move back to pre-start
<j_> so you have a queue
<Keybuk> no
<j_> how did you do?
<Keybuk> as I said, making the event expression indempotent
<Keybuk> once evaluated to true, the result is copied into the job
<Keybuk> and then the expression is cleared
<Keybuk> leaving it to be evaluated again immediately
<Keybuk> ( bah, lifeless isn't online ...
<Keybuk>   I can't troll him with BZR IS GIVING ME A SUB-OPTIMAL EXPERIENCE
<Keybuk>   "git would handle my use case much better"
<Keybuk>   etc. :p )
<Jc2k> troll me if you like, im the anti-git troll on ddl after all :)
<Keybuk> unfortunately I don't like git either
<Keybuk> I rather like bzr
<Keybuk> except when it behaves like a moronic child, like it's doing right now
<Keybuk> *all* I want to do is cherry-pick commits
<Keybuk> apparently this is hard
<Jc2k> :D
* Jc2k suddenly remembers your pro-bzr blog post :)
<Keybuk> Holy Crap
<Keybuk> 0.3.8 was released exactly 7 months ago
<j_> And when will arrive the new release?
<Keybuk> which new release? :)
<ion_> Upstart XP
<AlexExtreme> Huh? XP? Don't you mean Vista? ;)
<Keybuk> wasn't Vista the name of an Amiga program to render landscapes?
<j_> 0.3.9 or 0.4.0
<Keybuk> there won't be an 0.4.0
<Keybuk> next planned major is 0.5
<Keybuk> see topic :)
<j_> I'm currently read the webpage
<Keybuk> https://lists.ubuntu.com/archives/upstart-devel/2007-October/000468.html
<j_> yes
<ion_> Hm. I remember the program, but i dont remember its name.
<ion_> It was a really cool piece of software. :-)
<ion_> (Assuming were thinking of the same Amiga program that generates landscapes.)
<Keybuk> Wikipedia says it was Vista
<Keybuk> and then later, VistaPro
<ion_> Anyone watch Heroes? http://heh.fi/heroes/ </spam>
<Keybuk> ion_: am about half way through it
<Jc2k> im in search of s2
<ion_> Have you read the comics? The episodes often assume youve read the corresponding ones as well.
<ion_> (And thus the page, to easily know which ones to read between which episodes.)
<Keybuk> ion_: I didn't even know there were comics
* Jc2k too
<ion_> Some times the comics enlighten the history of existing characters; some times they even originally introduce characters used in the following episodes.
<Keybuk> j_: https://launchpad.net/upstart/0.3/0.3.9
* ..[topic/#upstart:Keybuk] : Upstart 0.3.9 | http://upstart.ubuntu.com/ | http://people.ubuntu.com/~fabbione/irclogs/ | https://lists.ubuntu.com/archives/upstart-devel/2007-October/000468.html
<j_> Keybuk: thanks
#upstart 2007-10-12
<toidinamai> Hello.
<toidinamai> How does upstart compare with runit or djb's daemontools?
<Jc2k> toidinamai: i am in no way even close to an expert on the subject, but runit seems very minimalist in comparison to upstart
<Jc2k> thats not meant to say that upstart is fat, just that it has a larger scope
<Jc2k> i can't see that daemontools even tries to replace init, so that would be the difference there
<Jc2k> my understanding is that upstart tries to be a really flexible event based service manager
<Jc2k> so you can configure a service or job to run each time a service is starting, started, stopping or stopped
<Jc2k> but also on a time event
<Jc2k> or even on a HAL event
<Jc2k> runit and daemontools just seem concerned with getting things started or stopped, and your left to handle dependencies in your scripts rather than taking advantage of a ready made dependency handler
<Jc2k> toidinamai: the best guy to answer your question is probably Keybuk
<Jc2k> he's on UK time if that helps you plan when best to come on IRC (04:43AM is a little early for us brits ;D)
* Starting logfile irclogs/upstart.log
<toidinamai> Jc2k: Thanks.
<toidinamai> Jc2k: I'm on CET but my sleep schedule is currently a little off. :-)
<toidinamai> Keybuk: Does upstart supervise its services like daemontools or runit?
<Keybuk> hello
<Keybuk> err
<Keybuk> Upstart supervises services, so can respawn them if they die
<Keybuk> I don't know whether it supervises them in the same way as daemontools or runit though
<Keybuk> (but maybe you didn't intend to ask that)
<toidinamai> Hm, I guess I'll just have to try it out.
<toidinamai> I'm currently using runit as an init replacement everywhere I can but it still needs a lot of fine tuning.
<Keybuk> I can probably answer specific questions in quite detail
<Keybuk> though I don't know how the other tools behave
<toidinamai> Ok.
<toidinamai> So upstart doesn't use the traditional init scripts at all, is that right?
<Keybuk> right
<toidinamai> How does it deal with scripts installed by packages like openssh-server?
<Keybuk> what kind of scripts?
<toidinamai> /etc/init.d/ssh
<Keybuk> it ignores them completely
<Keybuk> the usual way you install Upstart is to have Upstart jobs emulate the lines in your old inittab
<Keybuk> (running /etc/init.d/rc, or whatever)
<Keybuk> so existing init scripts are run by the existing sysvinit scripts, etc.
<Keybuk> leaving you free to convert over to Upstart jobs at your leisure
<Keybuk> obviously you don't get any kind of supervision for legacy init scripts
<toidinamai> Hm.  I sometimes get conflicts that way when using runit.  After installing a server package dpkg adds it to the runlevels and tries to start it.
<toidinamai> Upstart uses traditional logging using syslog, right?
<Keybuk> kinda
<Keybuk> I hate valgrind
* Jc2k chuckles
<Keybuk> ==29463== ERROR SUMMARY: 348 errors from 18 contexts (suppressed: 11 from 1)
<Keybuk> it keeps finding errors in code I'm happy with
<Jc2k> :-\
<Jc2k> how dare it!
<ion_> Another guy got valgrind to segfault just a while ago.
<Keybuk> valgrind usually segfaults because your program does
<ion_> Well, it spewed an error like valgrind: the impossible happened first. :-)
* Jc2k lols
<Keybuk> ==29490== Invalid write of size 4
<Keybuk> ==29490==    at 0x80523D5: nih_list_cut (list.c:202)
<Keybuk> ==29490==    by 0x80524A9: nih_list_destroy (list.c:246)
<Keybuk> ==29490==    by 0x8051096: nih_free (alloc.c:336)
<Keybuk> ==29490==    by 0x804C3A4: test_dir_walk (test_file.c:793)
<Keybuk> ==29490==    by 0x8050CC1: main (test_file.c:1336)
<Keybuk> oopsy
#upstart 2007-10-13
<AlexExtreme> is it intentional that 0.3.9 isn't mentioned anywhere on the website? :)
#upstart 2007-10-14
<Konam> hi
<Jc2k> lo
<Konam> someone know how can I change the resolution of the upstart screen
<soren> Konam: There's no such thing as "the upstart screen"
<Konam> soren fuck, yes, sorry, I was referring to usplash :D
* Jc2k chuckles
<Keybuk> yay, I have a garden now :)
<Jc2k> Keybuk: plan to grow anything :P?
<Jc2k> or just get drunk in it?
<Keybuk> just relax in it
<Jc2k> eh
* Keybuk doesn't drink :)
<AlexExtreme> mmm. why wasn't 0.3.9 announced on the website? :)
<Keybuk> oops
<AlexExtreme> Keybuk: still around/
<AlexExtreme> *?
<AlexExtreme> Keybuk, would you mind removing the link to Frugalware packages on the download page? that repo is out of date, and I'm actually no longer a Frugalware developer ;)
<Keybuk> sure
<mbiebl> AlexExtreme: will frugalware still use upstart as default init in their next release?
#upstart 2008-10-07
<sadmac2> Keybuk: had a question about dependency behavior
<Keybuk> sure
<sadmac2> Keybuk: ok, so we want to start all possible services for a given set of states.
<sadmac2> if service X depends on session, we start one per session
<sadmac2> this is good
<sadmac2> the easy way to do this is to scan the list of active states for each dependency of a state, and then take each combination of the results and make sure there's a service running for it
<sadmac2> now, suppose we have a Session state, and a service G which depends solely on the Session state and auto-starts
<sadmac2> so if we have user A and B logged in, they each have a service G
<sadmac2> now, what if we start up a service C that depends on the Session state and on service G?
<sadmac2> We get 4 copies of service C
<sadmac2> One for your session/your service G, one for your neighbor's session and service G
<sadmac2> one for your session and your neighbor's service G, and one for your service G and your neigbor's session'
<sadmac2> Keybuk: I can fix this behavior a couple ways. what's the right way to behave though?
<ssalevan> ahh, greetings, sirs
<sadmac2> Steve-O!
<ssalevan> it is I.  what is up?
<sadmac2> we were discussing some depsolving behaviors
<ssalevan> related to depsolving dependent services?
<Keybuk> sadmac2: sounds like some intelligence required there
<sadmac2> ssalevan: yes
<Keybuk> since neighbour's service G and our session are theoretically not compatible
<sadmac2> Keybuk: well, the dumb solution is to match the parameter out of G. so you say when session and G($session_id)
<sadmac2> Keybuk: but why bug the user with that when the typical behavior is probably never right?
<Keybuk> it should do the right thing
<sadmac2> Keybuk: what I have now is this "rooting" check. Basically any set of dependencies of any state cannot depend on anything outside that set iff something inside the set will meet the same dep
<Keybuk> that sounds like it would dtrt
<sadmac2> yeah, that's what I thought
#upstart 2008-10-08
<sadmac2> Keybuk: care to see some state machine?
#upstart 2008-10-09
<sadmac2> Keybuk: I have some progress on the state machine
<ion_> Have you looked at ragel?
<sadmac2> ion_: what is that?
<ion_> apt-cache show ragel
<sadmac2> ion_: redhat employee
<suihkulokki> yum yum :P
<ion_> Iâm sure youâre able to apply the information. :-)
<sadmac2> ion_: ah
<sadmac2> ion_: not quite what what we need
<ion_> Alright
<sadmac2> it supports D?
<sadmac2> o...k.....
<sadmac2> good to see someone's interested
 * Keybuk will be interested in November :p
<sadmac2> Keybuk: I meant interested in D
<sadmac2> Keybuk: and what's in November?
<Keybuk> the start of the next release
<Keybuk> and most importantly, the end of this one :p
<sadmac2> ah
<sadmac2> that'd do it
<smagoun> I'm having trouble creating new upstart jobs - I have to reboot before initctl recognizes the job. My kernel has CONFIG_INOTIFY=y, so i expected the new job to be available immediately. I have upstart 0.3.9-2 on ubuntu 8.04. I checked permissions on the new job, they're fine (root/root, 0644). Any suggestions?
<smagoun> specifically, 'start newjob' returns 'Unknown job' and 'initctl list' doesn't show the new job until I reboot
#upstart 2008-10-10
<smagoun> to answer my own question - upstart+inotify is only broken on systems that use squashfs, like ubuntu mobile, it works fine on plain old ext3
#upstart 2008-10-11
<o_cee> hello! trying to make an upstart script for spawn-fcgi, but ran into a problem.. how can I make sure the socket is chmodded 770, since I have to run the script from the upstart script without daemon mode?
<o_cee> if I use daemon mode i can just stick it after it, but then upstart don't know about the status of the task..
<o_cee> maybe easier to use port instead of socket
<mbiebl> o_cee: why is the socked chmod 770 if you run the script in daemon mode?
<mbiebl> Or do you chmod manually?
<o_cee> mbiebl: problem is that the socket is 766 or something instead of 770
<o_cee> yeah, don't know why spawn-fcgi does that, but i've solved it before by chmodding it afterwards
<o_cee> but, seems port+addr instead of socket works fine, so i'll use that instad
<mbiebl> o_cee: well, that you can do with a post-start script
<o_cee> yeah, but the it wouldn't be all upstart, right?
<o_cee> (never done any of these things before heh)
<o_cee> ah post-start, yeah, but it seemed to get reset when spawn-fcgi is run? couldn't get it to stick.. either way, port mode works just as fine i think
<voroskoi> hi
<sadmac> ion_: ping
#upstart 2008-10-12
<ion_> sadmac: pong
<o_cee> so, i tried implementing managing of my fastcgi processes via upstart.. seemed to work fine, then the server died and couldn't start. running ubuntu 8.04, and my best guess is that the starting is done at the same time as rc2 and by then fastcgi can't start (or something like that, I don't know much about init/upstart).. any general ideas how to make sure such things work as they should?
<o_cee> maybe i can add "initctl emit lighttpd_loaded" in lighttpd init.d script and use that as starting signal for fastcgi? is that a bad idea in any way?
<sadmac> o_cee: sounds ok to me
<sadmac> ion_: would you care to write test cases?
<sadmac> I need someone to test the state machine prototype
<sadmac> someone that didn't write it :)\
<ion_> sadmac: I donât feel good enough to write any code at the moment, but perhaps some other day.
<sadmac> ion_: k
<o_cee> sadmac: mkay, i'll give it a try.. or i could have it depend on rc2 so that it's fully started before doing fastcgi? then i'd be sure everything else is running
<sadmac> o_cee: either works. may as well do the first one though. more upstarty
<o_cee> allrighty, thanks
<sadmac> o_cee: in fedora, we have initctl calls in /etc/rc that emit starting and started events for all the sysv scripts
<o_cee> sadmac: ah okay, sounds good. btw, any idea when for example ubuntu will be all upstart?
<sadmac> o_cee: when we're done rewriting it :)
<o_cee> ah :)
<o_cee> to avoid editing the init scripts in init.d (where my edits eventually be overwritten), can i do "start on started rc2"? would that work?
<sadmac> yes
<o_cee> that will start it after all of rc2 is done, right?
<sadmac> yes
<o_cee> cool, thanks. and what i have now, "start on runlevel 2" would make it start at the same time, thus probably creating my problem
<sadmac> yep
<o_cee> cool :)  the box is a server half of sweden away from me so i don't like when it doesn't restart hehe ;)
#upstart 2009-10-05
<Ng> Keybuk: sorry about that. filed now as bug #442963
<damjan> can I make a job in Upstart 0.6.3 that starts only when /dev/hvc0 is available?
<Esmil> damjan: I guess one way would be to write a udev rule to call emit when /dev/hvc0 is up
<ion> Upstart, or at least the Ubuntu package for it, seems to come with upstart-udev-bridge. I havenât looked what kind of events it emits, but i assume it does what you want.
<damjan> I tried find -name *udev* in Upstars source but nothing appeared
<ion> The packaging, then.
<damjan> man 5 init mentions a "device-added" event ... but doesn't say who generates it
#upstart 2009-10-06
<soren> damjan: Funny you should ask...
<soren> damjan: https://bugs.launchpad.net/bugs/372864
<damjan> funny as in, you are laughing all the way to the bank? :)
<damjan> thanks
<soren> Sure :)
<damjan> I don't think this is available in 0.6.3 .. (does launchpad corellate bug reports with commits??)
<ion> Karmic has 0.6.3, so what Scott said in the last message would work with it.
<ion> The tty-device-added event must come from upstart-udev-bridge.
<ion> Indeed, strings =upstart-udev-bridge:
<ion> %s-device-added
<ion> KERNEL=%s
<Keybuk> it does
<damjan> is upstart-udev-bridge going to be included in future upstart versions?
<ion> Future Upstart versions wonât need it, as theyâll have the functionality built-in.
<damjan> ion: how do you know this stuff? (it's a bit hard to come by upstart info)
<ion> damjan: The upstart-udev-bridge man page says sos.
<ion> so
<damjan> ahh :)
<Keybuk> damjan: you can just ask for upstart info ;)
<damjan> Keybuk: the problem is when you don't know what to ask ... Upstart is still new (and changing) and has possibilities that weren't available before
<Keybuk> that's certainly true
<damjan> I'm experimenting with Upstart on ArchLinux .. so far I have it working
 * Esmil too ;)
<ion> http://xkcd.com/645/ :-D
<testi_>  In 9.04 Upstart does not emit an event when a network device goes up, or a default route is added. How can I execute a script as soon as network is available (without busy waiting!)
<testi_> Ubuntu 9.04
<Md> testi_: use udev
<testi_> okay
<testi_> Hmm but there is an example event network-up (that is not emitted in Ubuntu). Use udev because upstart is incomplete? Or use udev to tellupstart that a ertain device has now an ip-adress?
<spaetz> Hi
<spaetz> Is it intended that a "restart dbus" kills my X server and restarts it?
<Keybuk> yes
<spaetz> without notifying or asking me?
<Keybuk> you told it to, why would it ask you?
<spaetz> because update-manager upgraded dbus which killed the X session which ran the update
<spaetz> and therefore my upgrade was left in a state of limbo with a non-functioning network-manager
<Keybuk> update-manager does not run "restart dbus"
<Keybuk> if you had a bug like that, you should contact your distribution
 * spaetz shrugs. All I did was running update-manager and it suddently restarted X
<spaetz> I understand that living on the beta-edge will expose me to stuff like that
<spaetz> but it's quite annoying. Also I used to /etc/init.d/dbus restart just fine without having X killed
<spaetz> so if you are not aware of the dependency tree, a lot of bad stuff can happen
<spaetz> who knows what else X depends on...
<Keybuk> I don't see that it's a bug
<Keybuk> if you're restarting services without understanding what depends on them, you deserve everything you get ;-)
<spaetz> it might not be a bug, strictly speaking. But I am very much afraid of restarting *any* service now when in a X session.
<spaetz> So, is there an easy way to find out the dependency tree?
<spaetz> If there is none, then I'd consider that missing crucial functionality :)
<Keybuk> no, because upstart doesn't work by dependencies
<spaetz> so, how do I find out what else would kill my X?
<Keybuk> read the /etc/init/gdm.conf fiole
<spaetz> e.g. restart hal? dbus? cups? How can I find out?
<spaetz> will do, and thanks for your patience
<Keybuk> and then you'll discover that Upstart had no part in your X server restarting
<Keybuk> and, in fact, your X server crashed *all by itself*
<spaetz> Keybuk: no crash. Windows suddently started closing one after the other
<Keybuk> it's crashing, just awkwardly ;)
<spaetz> hehe, ok. I'll read the gdm.com stuff and check it out
<spaetz> fortunately, i didn't have important stuff open
<spaetz> the critical line seems to be: start on (filesystem and started hal)
<spaetz> so when hal stops, gdm would stop
<spaetz> and I assume hal depends on dbus
<spaetz> ahh, and on udev. So no more udev restarts with running X either.
<Keybuk> no
<Keybuk> incorrect
<Keybuk> that means that when hal is started, gdm is started
<Keybuk> the "stop on" line is all about stopping, and that doesn't mention hal
<spaetz> so when hal stops, gdm wouldn't stop? ok
<spaetz> so then "restart dbus" making X restart must be a crash
<spaetz> I recommend to write a blog post about that :)
<Keybuk> when hal stops, X crashes
<Keybuk> that's quite different
<Keybuk> blog away ;)
<spaetz> may, I quote bits of our conversation to make things clear?
<spaetz> -> "may I..."
<Keybuk> sure
<Keybuk> though my conversation isn't exactly reveraling
<spaetz> hehe, was interesting enough to me, thanks for the time to explain stuff
<spaetz> next 24 days must be quite busy :)
<spaetz> bye
<mgoetze> Keybuk: about #433270 - where do those tty-device-added events come from? upstart itself? or do i need an appropriate udev configuration to emit them?
<Keybuk> upstart-udev-bridge
<mgoetze> that seems to exist in ubuntu, but i don't use ubuntu...
<spaetz> I'll probably cut out some parts of the conversation later. But here is a draft quoting us (it's more than bits for now :-) ): http://sspaeth.de/archives/1191-Upstart-killed-the-Video-star.html
<Keybuk> spaetz: the title is rather misleading
<Keybuk> since we already established that it's X that dies on its own
<Keybuk> sorry, but your blog post has no use
<Keybuk> you're not documenting anything, just bitching
<Keybuk> so I recall my permission to use anything I've said there
 * spaetz shrugs. Your call. Will remove the quoting.
<spaetz> we, did start the conversation that way though: 14:22 < spaetz> Is it intended that a "restart dbus" kills my X server and restarts it?
<spaetz> 14:22 < Keybuk> yes
<damjan> spaetz: yep, that dependecy on the system dbus in the X server is a new "feature"
<damjan> ... and it sucks
<damjan> btw, when I was asking (don't remmember what channel) the response was "dbus shouldn't be restarted"
<spaetz> damjan: agreed
<damjan> .. ever
<spaetz> haha. Code just shouldn't crash, mem leaks not happen, and Microsoft play nice :-)
<spaetz> everything should stand a reload of some other service without crashing on me
<mgoetze> spaetz: go ahead and write an operating system in erlang then. we're all looking forward to the result, i can tell you
<damjan> well, at least Dbus could be written in erlang :)
<damjan> incerdible, there isn't even a bug report on bugs.freedesktop.org
 * spaetz doesn't see what erland has to do with the fact that Xorg seems to have made a design decision that is just plain silly
<spaetz> s/erland/erlang/
<damjan> spaetz: an erlang dbus service could "restart" itself without bringing down the connections
<damjan> but yeah, the Xorg server just uses the standard lib that doesn't handle disconnections from the bus AFAIK
<spaetz> I see
<damjan> but this bug report claims it's a problem in gnome-session http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=527860
 * spaetz just found the same bug report :). THere is also one for Gentoo and Arch.
<damjan> spaetz: do you use Gnome?
<damjan> ah.. so it was a problem in Awesome too
<damjan> I should test this again
<spaetz> Gnome yes.
<damjan> ok, so in latest Xorg-server and awesome I don't have the problem .. so X is ok :)
<damjan> xorg-server 1.6.3.901 here
<ion> keybuk: I could rebase the fsck-locking branch against the ubuntu-core-dev branch. Or are you already doing that?
<ion> keybuk: Rebased and verified to work.
<ion> keybuk: âFlush standard output and error before spawning processes to make capturing logs easier (otherwise we end up repeating things still in the buffer).â Ah, so thatâs what it was. I guessed the behavior must be related to something getting duplicated with the forks that shouldnât, but i never got around to investigating it.
#upstart 2009-10-07
<lcapriotti> hi, I'm trying to exec a text-based installer when system has completed booting: http://www.friendpaste.com/1DWFdkL9xtCR9mBXF5XQZL
<lcapriotti> but the text installer cannot accept inputs
<lcapriotti> the login prompt is shown instead, superimposed with installer text output
<mgoetze> well, you should tell your login job not to start until the installer is done, of course
<mgoetze> and then you'll want something like "exec < /dev/console" in your script
<lcapriotti> what is I don't want/can't modify the tty1 upstart job?
<lcapriotti> would something like exec su -c "myInstaller" -l work?
<ion> exec openvt command
<lcapriotti> pls speculate
<lcapriotti> ion: exec openvt -s command worked, tks a lot!
<kindjal> Is there a target date for upstart 0.10 (even roughly)?  I'm interested in the "automatic" and "manual" feature being discussed for the 0.10 release.
<sadmac2> kindjal: its kind of in "when its done" mode, but I think we'd like to have it in the next 6 months
<sadmac2> well, we'd like to have it today, and release dates are meant to be broken, but...
<kindjal> Understood.  "it's done when it's done" is very understandable... I was just curious as to where it stood.  Thanks.
<kindjal> If I require a "chkconfig" like functionality for upstart, am I thus sort of stuck with a "link job files into /etc/init" until then?
<kindjal> By "chkconfig" I guess I really mean just "enable/disable" a job
<sadmac2> kindjal: yes. though that's what chkconfig is anyway :)
<kindjal> Yes... but upstart could eliminate the concept of "runlevel" which is sort of chkconfig's focus.
#upstart 2009-10-08
<Keybuk> queue_fsck: /mnt: queuing check
<Keybuk> mountall:mountall.c:564: Assertion failed in update_mount_dev_ids: mnt->udev_device != NULL
<Keybuk> damnit, ion
<Keybuk> ;)
<ion> Huh
<ion> Isnât the only point where queue_fsck is called right after thereâs an udev_device and it gets assigned to mnt->udev_device? :-P
<Keybuk> no ;-)
<Keybuk> what's the _needed thing about?
<ion> update_mount_dev_ids only does its work if _needed is true, that is, an udev event that might have updated the mapping has been received.
<Keybuk> right
<Keybuk> just trying to understand the logic :p
<Keybuk> it looks like the update_mount_dev_ids can be just called in fsck_lock()
<Keybuk> and that should do the no-device => always lock thing
<ion> But always lock what?
<Keybuk> loopback mounted image :)
<ion> The logic probably should be extended to follow that image to the partition it resides on, and that partition to the physical devices.
<Keybuk> possibly
<Keybuk> except that the partition it resides on must be already mounted :p
<Keybuk> so there's little point <g>
<Keybuk> already mounted => already checked
<ion> Other images to be fscked may be on that partition.
<Keybuk> a fair point
<Keybuk> but then, arguably, you don't want to mount it either
<Keybuk> so the same locks should be applied to mounts too
<ion> Can mount be that IO-intensive? I can see a journal may need to be handled or something like that, but still.
<Keybuk> if that's /usr
<Keybuk> and the other thing is /whatever
<Keybuk> then that means the boot will continue
<Keybuk> that's IO intensive :p
<ion> But it might just as well get to lock /whatever first and delay /usr. One could implement priorities, of course.
<Keybuk> :)
<Keybuk> it's one of those problems that gets deeper the longer you look at it, isn't it
<ion> Heh
<Keybuk> pushed to my branch
<Keybuk> feel free to much aroun
<Keybuk> muck around!
<ion> With the fsck queue, the worst case scenario is that /usr gets fscked after /whatever, but because thereâs no disk thrashing (if you have a HDD), itâs still faster than the worst case scenario with everything being parallel and fsck instances spending most of their time waiting for the disk to seek. I have no hard data, but iâd expect the worst mount to still be so fast it doesnât need queuing. With queue prioritization, one could get the boot time even ...
<ion> ... faster, of course.
<ion> Thanks. Iâll try to look at the loop mount case. Shouldnât be hard, just get the device from stat() and get an udev device object for that.
<ion> Meh, bzr rebase is stupid compared to git rebase.
<Keybuk> hmm?
<Keybuk> why rebase?
<ion> I just wanted to reset the branch to the ~ubuntu-core-dev state. merge probably would have done that, too. I just expected rebase to reset the branch to that state and then notice it doesnât need to do anything else. You know that frustration you get with git, because youâre not used to its workflow? I havenât studied bzr enough to be entirely familiar with its inner workings, so i get a similar thing with bzr. :-P
<Keybuk> heh
<ion> % bzr reset --help   
<ion> bzr: ERROR: unknown command "reset"
<Keybuk> revert ;)
<ion> bzr checkout does the wrong thing, too :-P
<Keybuk> bzr's command set is more like svn's
<Keybuk> whereas git's is more like an evening at the pleasure of the spanish inquisition's more perverted torturer
<ion> With loop mounts, mnt->device is /foo/image, right?
<Keybuk> yes
<Keybuk> unless it's /dev/loop0 ;p
<ion> Would it be ok to iterate through mnt->deps and set dep->udev_device = udev_device if it dep->device looks like an image file near the line that sets mnt->udev_device in try_udev_device?
<Keybuk> isn't that wrong?
<Keybuk> ie. exactly the wrong way around
<Keybuk> mnt->udev_device = dep->udev_device is maybe right
<Keybuk> but then how do you deal with multiple parents?
<ion> Ah, i guessed the meaning of mnt->deps incorrectly, assuming it would be nicer to keep a list of âwhich mounts depend on this oneâ, so that they can be handled easily when âthis oneâ is ready.
<Keybuk> I did the opposite
<Keybuk> it turns out to be more reliable
<ion> Now i need a struct udev *udev handle in update_physical_dev_ids, which may not have a mnt->udev_device. Would it be okay to make udev file-global?
<ion> update_mount_dev_ids, that is, which i think should be renamed as update_physical_dev_ids. :-)
<Keybuk> sure fiddle away ;)
<ion> How to commit certain changes to a file, leaving the rest for the next commit?
<ion> in bzr
<ion> Similar to git add -p
<ion> keybuk: Pushed to https://code.edge.launchpad.net/~ion/ubuntu/karmic/mountall/fsck-locking
<sadmac> ion: bzr shelve is how you do add -p stuff. Its git stash essentially. You put away the bits you /don't/ want to commit
<ion> Alright, thanks
<mugwump> Sometimes, when a system goes wrong, you need to go through the boot process piece by piece
<mugwump> With SysV-style init, this is relatively easy.  How do I debug very early stage bootup problems using upstart?
<mugwump> I just replaced a hard-drive, see, and so I copied over using 'dd'
<mugwump> chaos is ensuing..
<mgoetze> in upstart 0.3, is there some way to specify that the post-stop script should only be run if the main script ran successfully?
<sadmac2> mgoetze: you can tell from one of the environment variables whether the service is stopping or failing... don't remember what its called...
<sadmac2> mgoetze: but basically you could do that and just have your post stop script quit immediately if the service failed.
<Keybuk> actually you can't
<sadmac2> Keybuk: not exported there/
<sadmac2> *?
<Keybuk> right
<sadmac2> oh, he said 0.3, right.
<sadmac2> Keybuk: we changed that in 0.6 didn't we?
<ion> keybuk: It seems 0.2.0~ never remounts the root partition rw. Iâll investigate today.
<Keybuk> ion: yeah I know why that is ;)
<Keybuk> bit of a think-o
<ion> keybuk: But other than that, the locking and everything seems to work with the PPA package. My branch also seems to handle the locking for loop mounts correctly.
<Nattgew_> how should i run a script at startup and shutdown using upstart?
<sadmac2> Nattgew_: depends on when precisely you want that to happen
<Nattgew_> well i have a script that i usually run at 99 on boot and at 01 at shutdown with the sysv scripts...
<sadmac2> Nattgew_: if you're on ubuntu or fedora, just install it as a sysv script like usual and it'll get run. If you're on another distro with a different/more exotic upstart config it'll depend on how they've set it up.
<Nattgew_> ok, i'm on ubuntu... i think i'm going to try using /etc/gdm/PreSession and PostSession
<sadmac2> Nattgew_: that does something slightly different. Possibly better.
<Nattgew_> yeah, i think it's more what i want. thanks for the info.
<sadmac2> np
<x-warrior> I'm using Ubuntu 9.10 Beta, installed bootchart and now i noticed that the boot time is longer. So I was thinking, the boot time increased? Or now with upstart bootchart can get a better (more real) time?
<sadmac2> x-warrior: might be more of a #ubuntu question, but I think I heard something about them starting boot chart earlier now (though its nothing to do with upstart)
<x-warrior> sadmac2, ok, sorry I will ask at ubuntu ;) 
#upstart 2009-10-09
<keesj> right in the center next to the photo camera
<ion> keybuk: o hai. My VM setup: http://heh.fi/tmp/mountall-test-setup-20091009, debug log with my branch: http://pastebin.com/f175ac4af
<ion> Nothing special about them, except that it seems to work. :-P
<Keybuk> ion: all merged, except I had a couple of alternate ways of doing it
<Keybuk> rather than the trigger thing, I changed the count to never call mounted() more than once
<ion> Alright
<Keybuk> \o.
<Keybuk> .o/
<ion> keybuk: I wonder how to handle e.g. the âapt-local /opt/apt-local vboxsf defaults 0 2â mount in my VM fstab that gives me easy access to, say, a recent build of mountall deb? The vboxsf filesystem becomes available when the virtualbox-ose-guest-utils init script loads a module. Currently i just have it as ânoautoâ, so that the system at least boots. :-P
<Keybuk> why doesn't it boot without noauto?
<ion> It gets stuck at the end, never sending the FHS event: http://pastebin.com/f775b90db (the last âmounted:â entry being âlocal 6/7 remote 0/0 virtual 12/12 swap 0/0â)
<ion> (Iâm still running a build from my branch pre-merge. Iâm about to do a new build, but that shouldnât fix it.)
<Keybuk> oh, hmm
<Keybuk> ah, I see the bug
<Keybuk> d'oh
<Keybuk> ion: try -r85
<ion> About to impact http://www.nasa.gov/55644main_NASATV_Windows.asx
<ion> keybuk: Great, it works.
<Keybuk> it makes you wonder whether Obama has a "sorry, we blew up the moon" speech prepared
<Keybuk> just in case
<ion> We launched a rocket toward the moon with an intention to detonate an explosive, but upon impact it accidentally the whole moon.
<mgoetze> i think it will be revealed that blowing up the moon was, in fact, necessary, as an alien invasion was being staged there, and that that is, in fact, the reason why obama is getting the nobel peace prize
<ion> keybuk: Can we get events from Upstart about things being mounted by others? The vbox-guest-utils init script runs mount -a -t vboxsf after loading the module, but mountall is left to sleep forever thinking /opt/apt-local never got mounted.
<ion> s/Upstart/udev/, brainfart
<Keybuk> oh, I was going to poll mountinfo!
<damjan> ion: how do you watch it on Linux? LCROSS
<ion> vlc played both the stream i linked and http://playlist.yahoo.com/makeplaylist.dll?id=1368163 which had better quality but which suffered from congestion.
<damjan> it seems to be the same thing.. that .asx link is just  a xml file and it has a ref to http://playlist.yahoo.com/makeplaylist.dll?id=1369080&segment=149773
<ion> keybuk: http://pastebin.com/m403ae9cd btw ;-)
<ion> keybuk: How about making nih_logger_printf() fflush the fd after each message? It would help with e.g. stracing mountall; youâd know which part of the code is running based on the debug write()s. Also, the latest log messages might only reach a log file after a long delay if the output has been redirected to a file, mountall is waiting for something and the buffer doesnât quite reach its capacity.
<Keybuk> fflush is expensive
<ion> I encountered both situations with debugging mountall. I simply added the flushing to nih_logger_printf temporarily. :-P
<ion> if (nih_log_priority >= NIH_LOG_DEBUG)?
<ion> <=
<Keybuk> ion: tabstop-agnostic indentation - give me an emacs file for that ;)
<ion> Since my editor doesnât do that either (AFAIK), i just indent with spaces in my own code. :-P
<Keybuk> style < effort :p
<Keybuk> and I use C-A-\ all the time
<Keybuk> (reindent buffer)
<ion> TBH, iâd indent my code with spaces only anyway, i rather like a smaller amount of indentation.
<Keybuk> :p
<sadmac2> my JLS confirmation just arrived :)
<sadmac2> In Japanese :(
<Keybuk> fail
<Keybuk> æ even
<sadmac2> Keybuk: from what translating my literate friend has done, I need a copy of the email to get into the conference too. That's gonna be fun for some people.
<sadmac2> Keybuk: especially those people who's spam filters have figured out the incredibly effective "foreign language => junk" heuristic
<ion> JLS?
<sadmac2> ion: Japan Linux Symposium
<ion> ââ¢ Upstart 1.0 by Scott James Remnant  [slides]â Itâs a placeholder for a link. :-(
<sadmac2> ion: where is that?
<ion> http://linuxplumbersconf.org/2009/program/
<sadmac2> yeah, I wonder when the videos will be available
<Keybuk> ion: my laptop hard drive died
<Keybuk> so I haven't rescued the slides off it yet
<ion> Ouch
<sadmac2> Keybuk: mine showed up broken and yours didn't make it out
<ion> keybuk: As for âdonât queue filesystem check when device is ânoneââ, how about âif device doesnât begin with a slashâ instead?
<Keybuk> you might have a legitimate reason for checking those
<Keybuk> *shrug*
<Keybuk> fsck.fuse may exist for example
<ion> keybuk: http://bazaar.launchpad.net/~ion/ubuntu/karmic/mountall/fsck-locking/revision/88
<Keybuk> no, I meant mnt->type there
<ion> Ah, ok, the debian/changelog entry mislead me. :-)
<Keybuk> you can add another check though ;)
<ion> http://bazaar.launchpad.net/~ion/ubuntu/karmic/mountall/fsck-locking/revision/88
<Keybuk> you'll need to rebase that too ;)
<ion> pushed
<ion> Or did you already publish 0.2.0, i.e. should i increment version?
<Keybuk> i did
<ion> Wouldnât it be better for mount_event to be asychronous? Send the call, go back to main loop and proceed to run_mount/swapon when the call finishes.
<Keybuk> maybe
<Keybuk> but the idea is to just start essential services for that mount
#upstart 2010-10-13
<BLZbubba> what version of upstart will rhel6 use?
<plautrba> BLZbubba: Beta has ftp://ftp.redhat.com/redhat/rhel/beta/6Server-beta2/x86_64/os/Server/Packages/upstart-0.6.5-6.1.el6.x86_64.rpm
<BLZbubba> plautrba: cool ty
#upstart 2010-10-14
<pharvey> can I share variables between pre-start script and script sections?
<robinsmidsrod> what might be the issue when a custom upstart job doesn't start at bootup on ubuntu 10.04 ?
<robinsmidsrod> is there a special way to install them, except for creating a file in /etc/init (or symlinking in)
<BLZbubba_> upstart is still quite difficult to debug, but there are kernel command line options to show more details to the screen
<BLZbubba_> it really needs a way to log debugging to a file, that would be the most helpful
<robinsmidsrod> do I need the event start on local-filesystems for something to boot at startup, or is it enough with start on runlevel [2345] ?
<BLZbubba_> what does it depend on?
<robinsmidsrod> what are the kernel paramerets for increasing debugging?
<robinsmidsrod> okay, this is something interesting - if I boot and run initctl list as root, the jobs don't show up in the list, but if I do initctl reload-configuration they show up
<robinsmidsrod> the jobs are symlinked into /etc/init, and they are owned by a non-root-user
<robinsmidsrod> is that a potential problem?
<Mikoto-Itoshiki> hello, any one on, right on. i have a fedora 10 install of 3.9 and i want to check that installed alright.
#upstart 2010-10-15
<piratelv> Hi all.
<sadmac> win 30
#upstart 2011-10-11
<aimka``> hello
<aimka``> is it normal that when I run a `initctl restart <job-name>`, the PID of the process does not change ?
<aimka``> (furthermore, the pre-start script defined in my job is not executed)
#upstart 2011-10-12
<mr_daniel> Upstart executes all jobs in /etc/init at boot-time. The first event emitted is 'startup'. Is there a tools which prints a semi-ordered graph to see which job starts another job? I want to understand the boot order of jobs to debug a small problem-.
<ion> initctl2dot
<mr_daniel> thanks for suggestion ion 
#upstart 2011-10-13
<TJ__> if i have the init script called rc.conf that handles the system-V compatibility, i should be able to have some script start when this is finished by having  start on stopped rc   right ? 
<jhunt> TJ__: if by script you mean job configuration file (/etc/init/*.conf), yes.
<TJ__> ok... strange, all jobs that have that start line, dont seem to start
<TJ__> have to dig little deeper then 
<TJ__> jhunt, can this event  stopped rc be forced ?
<jhunt> TJ__: you can do that, but why would you want to?
<TJ__> to test if the job is started
<jhunt> TJ__: status <job>
<TJ__> its stopped, while other jobs with same "start on condition" have been started
<jhunt> TJ__: http://upstart.ubuntu.com/cookbook/#init-checkconf
<TJ__> aaaaah
<TJ__> damn
<TJ__> found it
<TJ__> thanks
<jhunt> TJ__: np.
<TJ__> what process is in charge of starting jobs based on scripts in the etc/init dir ?
<TJ__> and what if that process starts after the start-on condition is met in any of these scripts ?
<jhunt> /sbin/init aka "upstart". I would highly recommend you read the upstart cookbook, and "man 8 init" and "man 5 init".
<TJ__> oki. thanks.
<vaxerdec> does the version number of "example jobs" match the feature set of upstart at the time it also had that version number?
<jhunt> vaxerdec: what example jobs are you referring to?
<vaxerdec> and same question for libnih
<vaxerdec> the ones on the download site
<vaxerdec> the tarballs
<jhunt> ?
<vaxerdec> http://upstart.ubuntu.com/download/
<vaxerdec> latest there is 0.3 for example-jobs.  does this mean that they do not use any features added after 0.3 release?
<jhunt> vaxerdec: I don't know, but quite possibly. as you can see, they haven't been updated in a while.
<jhunt> vaxerdec: If you're wanting to write a new .conf file, I'd look at the cookbook, the man pages and a recent Ubuntu system for lots of good examples.
<vaxerdec> yes.  i've tried hunting for stuff, i am going to do a wholesale conversion of all my init scripts.  i am successfully running fedora 15 with their shipped version of upstart (1.2)
<vaxerdec> i am long-time redhat user.  however i upgraded my system from 14 to 15 and it was only then that i discovered the horrible abombination called systemd
<vaxerdec> abomination
<vaxerdec> that is not unix software.
<jhunt> :)
<vaxerdec> i read countless mailing list archives to familiarize myself.  that guy lennart is a total jerk frankly.
<vaxerdec> he is incredibly arrogant and fills his arguments with logical fallacies, then tries to accuse others of doing it
<vaxerdec> i can't believe redhat did that... i'm shocked.  upstart is much more sensible
<vaxerdec> this systemd junk appears to want to replace my entire unix operating system with a single C binary that does everything.
<vaxerdec> i took a look at some of your dev branches
<jhunt> Yes, Upstart actively tries to avoid that model.
<vaxerdec> then why are you stuffing crond into it?
<jhunt> we haven't stuffed crond in Upstart.
<vaxerdec> there's a perfectly good cron daemon that exists already.  it's called crond.  or cronie, or anacron, or what have you.
<vaxerdec> looks like in your devel branches as well as some notes.  refers to replacing cron
<jhunt> Keybuk wanted to implement an Upstart bridge to provide a cron-like facility. That feature doesn't currently exist although.
<vaxerdec> next it will be /bin/ls and i have to use dbus to talk to upstart to run a directory listing.  please don't :) upstart is good (except for apparnt dbus dependency).  don't make mistake lennart does with systemd.
<vaxerdec> trying to subsume all the standard system things into one daemon
<jhunt> you misunderstand - upstart uses "bridges" for such additional functionality. These are out-of-process daemons that extend Upstart - they are not part of the core.
<vaxerdec> over dbus?
<vaxerdec> what happened to plain unix sockets or even ip?
<vaxerdec> i'm not running dbus on my system now, and i hope i won't be prevented from upgrading upstart because of apparent dependencies on dbus
<vaxerdec> do you know if i'll have to?
<vaxerdec> have a dbus transport layer running, that is.  in order to be able to even use later versions of upstart
<jhunt> Upstart doesn't require a dbus-daemon process to be running - it has its own dbus server internally. However, it does use unix sockets too for performance.
<vaxerdec> i don't mind having to build in a dbus library... well, i do, but it's a compromise as long as i don't have to use it and run a separate bus service.
<vaxerdec> although it would be nice if the dbus could could be turned off completely... like ifdef'd out
<vaxerdec> dbus code rather
<vaxerdec> ahhh, that's a relief
<vaxerdec> i noticed in changelog you had started to say that it is "now required" and it had been "added as a dependency"
<vaxerdec> which made me nervous.  i'd have to start calling a shell script as /sbin/init and do it all myself! (will kernel even run an interpreter for pid 1? hmm)
<vaxerdec> well, as in, a standalone scripot with a hash-bang line... 
<vaxerdec> i've got to figure out a way to stop this guy lennart.  this man is insane
<vaxerdec> he wants to put everything and anything in his precious systemd.
<vaxerdec> also this totally specious argument about fast boot... i mean it's silly.  are people continuously rebooting their computers or something? really how important is that to shave off microseconds from the boot time?
<vaxerdec> sure, parallelizing things and doing async socket IO is great.  can we be done now? it's fast enough already.  if upstart gets close to that speed (which it probably is already, with properly written stanza files), then it's plenty fine.
<jhunt> Upstart was designed from the outset for performance and reliability.
<vaxerdec> i think it is fine peice of software.  i have been playing with it so much today i totally shirked my other duties.
<vaxerdec> i noticed you guys have implemented the virtual services now? to form dummies for tacking onto? sort of like groups?
<jhunt> glad you're enjoying it.
<vaxerdec> i do think the model of event based that you started with rather than dependency based, is probably harder to debug and inherently less deterministic.  however it seems that you're basically implementing service dependencies now with the virtual services everyone can pin to.  if i understand them right
<vaxerdec> i really hope redhat's push for this systemd junk can be stymied somehow.  they even *had* upstart and then switched!!! grrrr
<jhunt> vaxerdec: RHEL 6 uses Upstart. Fedora uses systemd.
<vaxerdec> yes i was going to say that
<vaxerdec> it leads me to believe systemd will just be a failed experiment like so many others in fedora
<vaxerdec> the thing with upstart though is that you really have to *think* to get the scripts right sometimes.  and play around with it... unlike systemV, which a child could understand.
<jhunt> maybe, but sysV has serious limitations which Upstart overcomes.
<vaxerdec> also after switching and getting rid of ConsoleKit, it looks like nobody is setting permissions on the tty anymore, at least /dev/console
<vaxerdec> it looks like it used to be done in a pam limits file but that doesn't sound very good to me.  is it ok to chown right in the upstart script?
<jhunt> if you want to. However, udev should be doing that sort of thing for you.
<vaxerdec> hmm, that's quite a beast.
<vaxerdec> wait, it can only activate on device-change events though really, right? i mean that's when it normally is woken up
<vaxerdec> you'd still have to have upstart call some kind of udev trigger, i don't think someone logging out of the console and another one sitting down is anything that layer is aware of
<vaxerdec> udev is yet another peice this lennart fellow is talking about putting into his daemon.
<vaxerdec> reading rawhide changelogs, maintainer after maintainer is actually ripping *out* a perfectly working, maintained by upstream sysv init script (which could at least by an upstart system during rc.conf).  so i have to go off and find them somewhere, or write my own.  but that's good because almost none of their scripts were upstart-native anyways
<vaxerdec> s/by/be used/
<vaxerdec> and then a /run ? i mean just for your special software? an entry in the root of the filesystem? come on dude.
<vaxerdec> ok, i'll stop complaining now, sorry.
<vaxerdec> i just can't believe it.  the crap these guys are now trying to shove down my throat.  anyone using unix for just a few months would understand that all-in-one tools are anathema to the unix philosophy.
<vaxerdec> i just was so glad there was a good alternative in upstart.  i wanted to thank you guys for keeping your eye on the ball and putting out some really good work.
<vaxerdec> one problem i see though getting this adopted is lack of standard names conditions for special events that form sequencing barriers... i mean all the events that come out of the scripts themselves voluntarily, from 'emit'
<jhunt> have you seen "man upstart-events" on ubuntu?
<vaxerdec> i now about that, but it's ubuntu (and is not in the RH version for some unknown reason i can't fathom)
<vaxerdec> i sample a few upstart scripts from different distros and nobody has standardized
<jhunt> it is somewhat distro specific, but some standardisation would be a good thing I agree. It's on my list.
<vaxerdec> i think relying on special names may not be a great idea for that... if there was some way to rely on like "capabilities" of the init script that would be easier perhaps.  but then, i guess you'd have the same problem with capability names.  and not sure how you could programmatically determine some of these from upstart itself... maybe special names are the best/only way in fact
<vaxerdec> it would be really nice if vendors could all agree on the virtual-provides and -requires, the generic names... but i doubt it.  probably just stuck shipping different versions for each distro.  or sourcing a central file each distro has one of... like a 'services' map.
<vaxerdec> then again, we do have the LSB... and there are other examples of vendor cooperations
<vaxerdec> if you think about it, maybe it's not really distro-specific at a certain level of abstraction.  every server is doing basically the same thing with basically the same software.  even different unix platforms still are all roughly the same at that level
<vaxerdec> i guess the desktops would vary considerably though, hm.
<vaxerdec> you know dennis ritchie died
<vaxerdec> hm seems like we will soon have chrome on gtk/wayland running on KMS.
<vaxerdec> maybe finally i will have no more reason to use X (the graphical web browser).
<vaxerdec> anyways, ok i guess i am disproportionately talkative and mostly just blowing hot air
<vaxerdec> maybe i will switch to ubuntu.  screw these guys and their kiddie servers!
<vaxerdec> just so familiar with redhat ways...
<vaxerdec> i don't know if i could
<vaxerdec> i really can't stand the way-too-long name 'start-stop-daemon'
<vaxerdec> then again, /etc/sysconfig/network-services is way too long.
<vaxerdec> do you actually keep upstart-services(7) up to date anyways?
<vaxerdec> i haven't looked at your code yet either... I will check out trunk.
<vaxerdec> oh fascinating.  that "go" language from Google, was designed by Thompson and Pike
<vaxerdec> is trunk considered stable?
#upstart 2011-10-14
<bradleyayerswork> hi
<bradleyayerswork> I'd like to know the difference between "user jobs" and "system jobs"
<bradleyayerswork> is it just having a .init in home directory?
<bradleyayerswork> also, is it possible upgrade upstart on ubuntu 10.04?
<vaxerdec> you could always pull trunk and build it.  or the release version, 1.3
<bradleyayerswork> and is there any documentation around user jobs?
<vaxerdec> i dont know if the cookbook contains it.  but it seems to be shaping up quite nicely
<vaxerdec> i would not be surprised if they had documented it there
<vaxerdec> based on the sounds of it, just allowed users to make event triggers over dbus.  i don't know how they write the files to /etc/init
<vaxerdec> perhaps, they just write them in memory somehow into the dbus and it handles that on their behalf? this is just wild speculation.
<vaxerdec> i know dbus has some security models which allow it to broker access to privileged stuff.  no idea how they are using it... i am strong advocate of ripping out anything with the word "dbus" in it and throwing it in the garbage :)
<vaxerdec> i'm trying to figure out a way to get all /etc/init/*.conf from whatever serves as ubuntu trunk.  if you have a suggestion, please let me know...
<bradleyayerswork> i want to use upstart to manage web app processes, and user jobs "sound" like what i want, but it isn't documented :(
<bradleyayerswork> the only mention is "As such, all system job configuration files must live in or below /etc/init (although user jobs can live in other locations)." 
<bradleyayerswork> vaxerdec: as in, you just want to download the job files?
<bradleyayerswork> ah the man page has some stuff 
<bradleyayerswork> " Any user can create user jobs, but that user can control only jobs they create."
<bradleyayerswork> but what if i made something that just hooked the 'starting' event and blocked, causing it to never start
<vaxerdec> yes.  
<bradleyayerswork> that is concerning
<bradleyayerswork> i suppose that's just a messy problem to get around
<vaxerdec> i am using fedora and their upstarts are just a half-aborted attempt before they switched to systemd (yuck), they never ported to native upstart.  ubuntu apparently claims they have ported the majority of their init scripts to native upstart.  so, i want to use those as a conversion base for my own efforts (I am using upstat with Fedora, because I hate systemd)
<vaxerdec> yeah, well, even though they can schedule, i don't think they wil be escalating their privilges
<vaxerdec> it probably lets you specify a filename or directory then somehow.  and/or forces you to use your home dir
<bradleyayerswork> i just meant having "start on starting shutdown; script while 1 end script" etc
<vaxerdec> right but where do you put those? in a file. where do you put that?
<bradleyayerswork> in ~/.init/
<bradleyayerswork> http://manpages.ubuntu.com/manpages/oneiric/man5/init.5.html
<vaxerdec> clearly they don't set the sticky bit on /etc/init and call it a day :) although they may as well since it sounds from the "any user can..." that it's already DoS prone... but perhaps they rate limit.
<bradleyayerswork> search "User jobs"
<bradleyayerswork> there's a section
<vaxerdec> ah.  yes, the home dir then.  but, it might just take an arbitrary path.
<vaxerdec> i don't have the manual page.  i don't access to any ubuntu systems.
<vaxerdec> i will be sure to grab that though when i get those others from the scm repo
<vaxerdec> along with that other one that lists those pseudo-events
<vaxerdec> what is it? i forget.  something.7
<vaxerdec> something-else.7
<vaxerdec> it's just a table with all those virtual events like network-started
<vaxerdec> oh, you gave me a URL :)
<vaxerdec> ah yes, upstart-events.7
<vaxerdec> wait... there is no longer a "console syslog" ? only "owner" and "output?"
<bradleyayerswork> i don't know much about console
<vaxerdec> ahhh they have a udev bridge now
<bradleyayerswork> you seem to know more about this than me :P
<vaxerdec> i'm not sure i like it though... threatens to mix purposes.  i am wary that it will come out looking like systemd, please no :)
<vaxerdec> it's always tempting to roll other stuff in to your project.  just look what happened to that poor lennart fellow... he sold himself to the devil, clearly.
<vaxerdec> at least it's "only" a bridge.  but that encourages more use of dbus which i think is just all bad in this layer.
<bradleyayerswork> i'm not even familiar with d-bus, so i can't really comment :/
<vaxerdec> it's just an ipc bus designed for the desktop/gui/crap layer that some people (like redhat and systemd fools) will try to move lower in the stack and have everyone relying on their superfluous crap.
<vaxerdec> i mean, not as a business tactic... just some arrogant developers who think they understand the One True Way but clearly haven't been using unix very long or, if so, learned about its philosophy...
<vaxerdec> wait... does udev repeat the events over dbus? or are they getting them over netlink or something?
<vaxerdec> wow, just reading over some of these changes since 0.6... this has come a long way.  these guys are doing wonderful job with this.
<vaxerdec> documentation is getting fleshed out nicely too.
<bradleyayerswork> upstart >0.6 changes you mean?
<vaxerdec> eh? yeah.  i mean since version 0.6.  they are at 1.3 now for the release track.
<bradleyayerswork> yeah
<bradleyayerswork> ubuntu 10.04 has 0.6 :(
<vaxerdec> go to 10.10
<vaxerdec> not sure what version they have, probably 1.2
<vaxerdec> even my fedora system has 1.2 :)
<vaxerdec> and they abandoned upstart.
<vaxerdec> the fools.
<vaxerdec> well, i take that back.  it's still in RHEL
<bradleyayerswork> really? in favour of what?
<vaxerdec> systemd!
<bradleyayerswork> :O
<vaxerdec> the thing i have been talking about
<bradleyayerswork> yup
<bradleyayerswork> i made a bunch of changes to the upstart cookbook that i need to submit
<vaxerdec> it's WAY overscoped
<vaxerdec> what's the source language?
<bradleyayerswork> restructuredtext
<vaxerdec> oh sweet
<vaxerdec> i love it
<vaxerdec> i use it for everything
<vaxerdec> i just start started making trees and building it all with sphinx
<vaxerdec> for all my docs at work
<bradleyayerswork> ah yeah
<bradleyayerswork> i use it for my projects too
<bradleyayerswork> i wish it was more like markdown
<vaxerdec> it's so nice and terminal friendly :)
<vaxerdec> eh
<vaxerdec> serious?
<bradleyayerswork> in some ways, sure
<bradleyayerswork> like single ` rather than double
<vaxerdec> like what? what's the top hting you miss from markdown
<vaxerdec> yeah that gets tiresome
<vaxerdec> i just use editor macros
<bradleyayerswork> and remembering how to make URLs
<vaxerdec> oh right
<vaxerdec> everyone has issues with that
<vaxerdec> i usually just have the quickref up
<bradleyayerswork> i basically have to look at reference every time
<vaxerdec> :)
<bradleyayerswork> i also don't like having to have a new line before a list
<vaxerdec> gets even harder with sphinx you have to do stuff for cross references and likewise... they have like a hundred of their own '.. ' directives
<bradleyayerswork> :ref: is good though
<vaxerdec> oh yes, that is my biggest complaint with it
<vaxerdec> any change in indentation and you need to put a space
<bradleyayerswork> yeah :/
<vaxerdec> and you know what... it handles it with #. just fine
<bradleyayerswork> the whole infrastructure/design of it is good
<bradleyayerswork> but the syntax is annoying 
<bradleyayerswork> which is a shame
<vaxerdec> yeah that part is dumb.  i read a discussion on it and they said like they'd have to rewrite the entire parser or something to make that work
<vaxerdec> what part of the syntax is annoying?
<bradleyayerswork> just the things we've been talking about
<vaxerdec> mmm
<bradleyayerswork> hyperlinks, ``awef``, lists
<vaxerdec> tables can be irritating
<bradleyayerswork> yeah
<vaxerdec> if they're not just simple.  everything has to line up
<bradleyayerswork> yep
<vaxerdec> i'm using some package from drchip to do it automatically though, or just started to anyways.  looks promising.
<vaxerdec> yeah they are at 0.81 now i think
<bradleyayerswork> i just find stack overflow's language memorable
<vaxerdec> i keep reading the release notes to see if they fixed those
<vaxerdec> nobody seems to care about those issues and i am definitely no python guru
<bradleyayerswork> i am quite the python guru
<vaxerdec> oh really
<vaxerdec> fix it!
<vaxerdec> i took a look once...
<vaxerdec> it's all mixed up with block quoting (the list issue)
<vaxerdec> but you know... 
<bradleyayerswork> it seems like it'd be difficult to get accepted for political/backwards compatible reasons
<vaxerdec> if your output is html you can just give a list style
<vaxerdec> nah you just make it a command line switch.  they have so many already.
<bradleyayerswork> true
<vaxerdec> but then the code would have to work both ways, which is even more challenging :)
<bradleyayerswork> yeah :(
<vaxerdec> i mean it's just such an obvious thing though.  i am always dismayed that their core team doesn't mind that.
<vaxerdec> i think they just set style on their output.  i think the default style is totally ugly actually
<vaxerdec> for both latex and html
<vaxerdec> it actually makes pretty good man pages though
<bradleyayerswork> yeah
<bradleyayerswork> oh yeah? i haven't seen man page output
<vaxerdec> oh it's nice.  at least it looks nice in my colorized pinfo terminal :)
<vaxerdec> rst2man
<vaxerdec> actually the simple tables aren't so bad
<vaxerdec> just look at your man page for the upstart stuff... it's probably made by that if you say the web page is
<vaxerdec> i wonder if they figured out what to do with init.conf yet
<vaxerdec> do you know where the name 'upstart' came from?
<bradleyayerswork> nope
<vaxerdec> oh boy looks like i gotta figure out bzr to do this
<bradleyayerswork> good luck :)
<bradleyayerswork> i'm off
<vaxerdec> later
<TJ__> im a bit lost in all upstart versions at the moment; i have a job that is depending on some IFACE br0 to come alive. According to docs, upstart needs the upstart-udev-bridge to make this work. On the development ubuntu 11.04 system i have this bridge binary. On the system im building we use debian packages instead of ubuntu packages, and this debian package does not have the bridge, so the job isnt started....
<TJ__> does anyone have any idea how to fix this ?
<TJ__> btw the start condition for the job is : start on net-device-up IFACE=br0
<jhunt> bridge interfaces are handled by ifup on Ubuntu. See file /etc/network/if-up.d/upstart which runs, "initctl emit -n net-device-up IFACE=br0..."
<jhunt> the upstart-events man page explains this, although I appreciate it is pretty terse :)
<TJ__> ah.
<TJ__> i see
<TJ__> on the embedded system we have, we do have the /etc/network/if-up.d directory, but in there, there is no upstart file...
<TJ__> so if i create this file we should be done
<TJ__> working ! thanks jhunt 
<jhunt> TJ__: great! :)
<TJ__> how does it work on a debian system then ? the package we install does not have a upstart-udev-bridge binary so its not used there as well ?
<jhunt> TJ__: the version of upstart in debian is very old. This needs to be rectified.
<TJ__> aah... ok....   but then still... in my ubuntu development pc, we have the latest and greatest upstart provided by ubuntu, it has the upstart-udev-bridge, but still the if-up.d scripts are used... any specific reason why ?
<TJ__> or is this just something on ubuntu's todo list ? 
<bradleyayers> so I've written a user job, and I assume i wouldn't need to use sudo with initctl (if i do, it  says unknown job)
<bradleyayers> $ start my-test-job 
<bradleyayers> start: Rejected send message, 1 matched rules; type="method_call", sender=":1.27" (uid=1000 pid=1480 comm="start my-test-job ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")
<bradleyayers> this is on ubuntu 11.10
<jhunt> jobs are run as root, so you need to be root to start them :)
<bradleyayers> doesn't that contradict the point of user jobs?
<bradleyayers> the man-page suggests users can control only their jobs
<bradleyayers> or am I just missing something :S
<jhunt> sorry - didn't notice that you were using user jobs. User jobs are not enabled by default in ubuntu, even 11.10. Looks like the man page is reflecting the upstream version of upstart. We need to fix that.
<bradleyayers> i've been making some edits to the cookbook, by editting the restructuredtext source
<bradleyayers> what's the best way for me to get the changes to you?
<bradleyayers> just a bug ticket?
<jhunt> If you want to enable user jobs, you'll need to modify /etc/dbus-1/system.d/Upstart.conf so it looks like the upstream version: http://bazaar.launchpad.net/~upstart-devel/upstart/trunk/view/head:/dbus/Upstart.conf
<jhunt> bradleyayers: please raise bugs as specified in the cookbook itself (https://bugs.launchpad.net/upstart-cookbook/+filebug)
<bradleyayers> and i'll just attach a patch?
<jhunt> that would be fine
<bradleyayers> great
<bradleyayers> thanks for the upstart.conf tip :)
<jhunt> np - thanks for pointing out the man page issue :)
<bradleyayers> and user jobs aren't really mentioned at all in cookbook either :(
<bradleyayers> what stops someone from writing a job that just hooks into some "starting" event, and then does a sleep 10000 etc.?
<bradleyayers> (task job)
<vaxerdec> bradleyayers: to what end? you mean to disrupt the operation of the system?
<bradleyayers> yes, to just denial of service
<bradleyayers> (inadvertantly or maliciously)
<vaxerdec> perhaps they haven't worked out those details yet, which is why it's not in the released version
<vaxerdec> there must be permissions checking...
<vaxerdec> might want to check out the code to find out
<vaxerdec> is there really a need for user events?
<bradleyayers> this isn't user events though
<bradleyayers> it's user jobs hooking global events
<vaxerdec> eh? what did you mean then?
<vaxerdec> right...
<vaxerdec> i guess that's what i meant
<vaxerdec> i meant, users interacting with the events in some way
<bradleyayers> well my use-case is having a script that i want to run when a database is running
<bradleyayers> and when the database is shutting down, my script should shut down
<vaxerdec> but you can't connect to the database?
<vaxerdec> you could run inotifywatch on the pidfile
<bradleyayers> ill have a look at inotifywatch
<vaxerdec> actually i'm not sure you can anonymously monitor that
<vaxerdec> .
<vaxerdec> i mean you could poll with stat() of course in the rundir but that's silly
<bradleyayers> yeah
<bradleyayers> there'll always be some manual scripting approach to check conditions etc
<vaxerdec> is there some reason you can't just maintain a connection to the database?
<vaxerdec> it'll probably dump you with a particular exit code even
<bradleyayers> but i liked the way upstart handles this type of problem with events
<vaxerdec> seems like the wrong mechanism to me
<vaxerdec> maybe you could subscribe to the event and it could broadcast them
<vaxerdec> i really have no idea what restrictions the dbus interface imposes
<vaxerdec> of course i'd just advocate a unix domain socket access by a client library in client's address space.  or possibly, arrange to be signalled.
<vaxerdec> this stuff is too fancy though.  should rely on helpers for all this... not build into init.
<vaxerdec> i mean, it's arguable
<vaxerdec> but pretty soon you guys are going to be putting tcp into the thing and doing notifications over the network
<vaxerdec> which actually sounds somewhat interesting if it weren't so dirty to be doing that in PID1.
<vaxerdec> i think perhaps it would be best to stick to current model where init has a specific role: to start, stop and reap processes only.  it's already spawning processes... why not have user-notify.conf which defines some other programs to do this stuff
<bradleyayers> hmm, you raise some interesting points
<bradleyayers> i think i do agree that user jobs are outside the responsibility of init
<vaxerdec> kitchen sink approach is tempting, but time has taught us that the unix way of trying to do only one thing is a superior model
<vaxerdec> this is exactly the problem with systemd although they are much worse and make no attempt to even limit the wreckage
<vaxerdec> shit why not stuff it all in the kernel and call it a day ;)
<vaxerdec> that will be next... modprobe systemd.ko
<vaxerdec> or maybe they will call it lennart.ko
<vaxerdec> now one thing i think is an excellent idea is the use of cgroups
<bradleyayers> i hear if you put it in the kernel it's fast
<vaxerdec> i would say the cgroups should go in a cgroupd but then you're just calling cgroupd and moving all the spawn logic from init to cgropud, which probably serves no purpose
<vaxerdec> unless you could somehow hand off...
<vaxerdec> cgroups are extremely powerful isolation and control mechanisms.
<vaxerdec> come to think of it, you could do that in pam
<vaxerdec> already pam does much/all of resource allocations and limit imposition
<vaxerdec> hm.  can upstart just start arbitrary services and have all requirements for that service come up, automatically and recursively? 
<vaxerdec> (no matter what state those other services were in)
<bradleyayers> well the dependencies might not all be for some things to be started
<vaxerdec> i'm not sure that it can... perhaps this is one argument for real dependencies.  once you had those the rest could be derived.
<bradleyayers> if there's other jobs that have hooked the 'starting' event of the thing you're starting, then they'll be started
<vaxerdec> i have to read more about changes they have made.  i think with earlier codebases perhaps this would have been difficult to know deterministically.
<vaxerdec> something else... the "it forked twice" or "it forked three times and i lost track" problem: couldn't that be solved by using netlink? i.e. via "proc connector" ?
<vaxerdec> oh hah.  i'm reading a post about it by one Scott James Remnant :) guess they are one step ahead! 
<vaxerdec> bradleyayers: is it mysql or postgres?
<bradleyayers> postgres
<vaxerdec> (assuming it is relational)
<bradleyayers> butâ¦ my usecase was a lie
<bradleyayers> (sort of)
<vaxerdec> bradleyayers: you could use notify(7)
<bradleyayers> i have a background worker for a web site that depends on postgresql and rabbitmq
<vaxerdec> i have just looked at zeromq, it looks quite lean.
<vaxerdec> now that's an ipc i wouldn't mind using.  but not in init :)
#upstart 2011-10-16
<bradleyayers> can I use pre-stop to shut down the job? or will it be respawned
<bradleyayers> it would appear, that it does respawn
<__machine> anyone know why my sickbeard upstart job doesnt get the right pid? ive tried expect fork and expect daemon and both get the wrong pidâ¦ my exec line does su -c 'python Sick-Beard.py â¦' me â¦ having the wrong pid means i cant stop/start it properly once startedâ¦?
<__machine> i also tried to cheat with start-stop-daemon, but initctl said it was started/running but had no pid, and it wasnt actually runningâ¦?
#upstart 2012-10-08
<gyre007> is there any way to send signals to upstart jobs ?
<gyre007> To daemonized
<SpamapS> gyre007: you can send SIGHUP with reload, or SIGTERM with stop (and if that is ignored, SIGKILL after kill timeout is reached)
<SpamapS> gyre007: you can also change SIGTERM to something else with 'kill signal XXXXXX'
<SpamapS> gyre007: other than that, you need to parse out the output of 'status jobname' to get the pid (which is really easy btw)
#upstart 2012-10-09
<Yann2> hi :) to write an upstart script with instances, I want for each instance to read a resource file, and then for all of them, to execute a script
<Yann2> is there a way to "close" an instance? like instance $conf [....] fi ?
<jodh> Yann2: you have to stop them, or have them stop themselves: http://upstart.ubuntu.com/cookbook/#attempting-to-stop-a-job-that-requires-an-instance-variable
<Yann2> jodh, that's not what I meant - I mean, the configuration part for an instance starts after instance $VAR , but ends when?
<jodh> Yann2: I think you're misunderstanding what instances are - they are normal jobs but include the stanza 'instance' followed by some variable name (or names). So, a running instance of a job configuration file with a particular value of the instance variable(s) is your instance.
<Yann2> yes, that's what I need :)
<Yann2> let me reformulate (sry, english isn't my main language)
<Yann2> I want to write a script that starts a daemon of which there could be many instances, hence the "instance"
<Yann2> so I want to read a configuration file, to set all environment variables (they will be different for every instance) - defining, let's say, the port of the daemon
<Yann2> then I would start the daemon with daemon -p $PORT
<Yann2> so this is what I would want to do:
<Yann2> instance $CONF
<Yann2> . /etc/default/${CONF}
<Yann2> and then if I want to add additional lines, after the instance, where does the instance section end?
<jodh> Yann2: I don't understand what you mean "add additional lines, after the instance" - the entire .conf file *is* your instance script.
<jodh> so, you could have a .conf file that did:
<jodh> instance $FOO
<jodh> script
<jodh> . /etc/default/$FOO
<jodh> echo hello from instance $FOO
<jodh> end script
<jodh> Then, start 2 instances:
<jodh> sudo start job FOO="abc"
<jodh> sudo start job FOO=1
<Yann2> mmmhhhh ok I think I'm getting it :)
<jodh> Yann2: I suggest reading http://upstart.ubuntu.com/cookbook/#instance
<jodh> in summary, the only "special" syntax for instance jobs is that they have the 'instance' stanza, and the rest of the job (the 'exec' and 'script' and 'pre-start script', etc) have access to the instance variable.
<Yann2> ok
<jodh> Yann2: I've updated the Upstart Cookbook with a simple instance example which I think covers what we have just discussed: http://upstart.ubuntu.com/cookbook/#a-simple-instance-example
<Yann2> did you save? I see no difference so far
<Yann2> and the anchor doesn't work
<Yann2> but I think I got it, it was just me being dump :)
<Yann2> dumb
<gyre008> arrghâ¦upstart is giving me hedeaches...
<gyre008> I'm trying to restart a serviceâ¦.and it's just hanging there indefinitely
<gyre008> anyone idea ?
<gyre008> this is my job definition
<gyre008> https://gist.github.com/3858894
<SpamapS> gyre008: what is hanging?
<gyre008> start
<gyre008> initctl start nginx
<gyre008> hangs indefinitely
<SpamapS> gyre008: that means your expect fork is likely wrong
<gyre008> m
<gyre008> m
<gyre008> its messy
<SpamapS> gyre008: any reason you're not just using the init script for nginx?
<gyre008> well people are singing how awesome upstart is...
<gyre008> looks its probably not ;0
<gyre008> this is killing me wtf initctl: Job is already running: nginx
<gyre008> NO ITS NOT
<SpamapS> gyre008: its awesome.. for what its meant to be awesome for
<SpamapS> gyre008: but there's no point in using it when there is already a perfectly good sysvinit script
<MFen> i'm having a problem getting a service recognized
<MFen> i added a file to /etc/init/ .. bulkagent.conf
<MFen> but status bulkagent doesn't do anything. i have another one i wrote that i set up the same way.. just dropped it into /etc/init.. and that one works
<MFen> what factors can cause a service to be omitted from the list?
<MFen> the syntax of the two files is nearly identical. permissions are the same. 
#upstart 2012-10-10
<MFen> let me put it another way.. what causes a service to be recognized as a service? just having a file in /etc/init? and what determines the name.. just the part prefixing ".conf"?
<SpamapS> MFen: init-checkconf /etc/init/bulkagent.conf
<SpamapS> MFen: also look in syslog for errors related to its syntax
<SpamapS> MFen: the name is everything before .conf yes
<SpamapS> MFen: and iwatch has to pick up the change in /etc/init .. you might try 'initctl reload-configuration' just in case
#upstart 2012-10-11
<ericbutters> hello. i got: init: mounted-proc main process (1277) terminated with status 1
<ericbutters> using ubuntu-core 12.04.1 on armv7
<ericbutters> where to find information about linux kernel features needed for upstart?
<jodh> ericbutters: odd - that job just calls chmod. Is there anything in /var/log/upstart/mounted-proc.log* ? does /proc/eslabinfo exist? what perms does it have?
<jodh> ericbutters: why do you need to know the kernel features?
<ericbutters> i can't boot into ubuntu because of that error. 
<ericbutters> i built kernel by myself
<ericbutters> i can boot into fedora 17
<ericbutters> jodh can not answer to your questions because i can not access the filesystem
<ericbutters> my kernel command line: console=ttySAC1,38400 rootfstype=ext3 rw root=/dev/mmcblk0p2 rootdelay=5 --no-log noinitrd
<jodh> ericbutters: you can remove --no-log now - upstart supports initramfs-less boot.
<jodh> ericbutters: try booting with "init=/bin/sh" and having a look around your system maybe?
<ericbutters> when i remove i get: https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/980917
<jodh> ericbutters: oh, sorry - hadn't seen you're running 12.04.1. yes, that SRU will be progressed soon :-)
<ericbutters> jodh i now have /bin/sh stated... what should i look around?
<jodh> well, remount root rw (http://upstart.ubuntu.com/cookbook/#boot-to-a-shell-directly) and then try mounting /proc maybe? You could then "exec /sbin/init" and see what you get. Why are you using your own kernel? Presumably, the system works normally with a stock Ubuntu kernel? If so, you should compare your kernel config with /boot/config-<version>.
<ericbutters> we are OEM, porting linux to our ARM based boards..
<ericbutters> FYI this is output: http://pastebin.com/raw.php?i=H4hTDAF0
<jodh> If the problem isn't with /proc, try adding --debug to your boot command-line.
<ericbutters> jodh: when bootargs with --no-log --> http://pastebin.com/raw.php?i=V8pe9KDG and when bootargs without --no-log --> http://pastebin.com/icfUFgt0
<jodh> ericbutters: the first error is because /bin/sh exited as it doesn't understand --no-log - that's an upstart option.
<jodh> can you boot with --debug?
<ericbutters> first w/ debug and no --no-log: http://pastebin.com/yLs7G3wQ
<ericbutters> secong with --no-log: http://pastebin.com/P9wc3g7h
<jodh> ericbutters: you appear to have modified the jobs - 'mountallServer' is not a standard event. Also, have you compared your kernel config with the stock ubuntu ones?
<ericbutters> jodh i did not anything to the ubuntu system. i compare with ac100 ubuntu defconfig at the moment. is not that easy. ac100 is 3.1.10 where my linux kernel is 3.3.7
<ericbutters> i can access by mounting the sd card on my devel machine. what to do to get this mountallServer disabled?
<ogra_> yo
<jodh> ogra_: hi!
<jodh> ericbutters: can you explain why you can't use the stock ubuntu kernel source + config and rebuild for your board maybe?
<jodh> ericbutters: I've double-checked and nothing that I can see in an standard ubuntu 12.04.1 system emits the 'mountallServer' event, so your system has been customised somehow. Try booting with init=/bin/sh and doing grep -ilr mountallServer /etc/init*
<jodh> for arm-specifics, you might also want to ask on #ubuntu-arm.
<ericbutters> uuhh that takes too much time, getting all the samsung specific things to work.. all works great with fedora. i just want to try ubuntu. 
<jodh> ? I don't understand sort, grep and diff should allow you to compare those 3 kernel configs??
<jodh> so I would compare kernel configs, ensure you have inotify and /proc compiled into the kernel, and identify what introduced the 'mountallServer' event.
<ogra_> and devtmpfs
<jodh> ogra_: yeah - and sysfs and tmpfs.
<ericbutters> jodh  grep -ilr mountallServer /etc/init* gives nothing
<ericbutters> jodh ogra_ all that is enabled in kernel
<ogra_> well, do you aheva  proper rootfs as well ?
<ogra_> *have a
<jodh> ericbutters: gah - mountallServer is a "red-herring" it was added to mountall a while back and sadly doesn't conform to the standard naming scheme.
<jodh> ericbutters: so, ignore that issue.
<ericbutters> orga_ i have a fedora 17 lxde running
<ogra_> if all kernel optiuons are there, /me bets on an incomplete rootfs
<ogra_> ericbutters, i dont care about fedora, its so massively different from ubuntu, it doesnt help to mention it every few mins
<ericbutters> i downloaded from ubuntu-core here: http://cdimage.ubuntu.com/ubuntu-core/releases/12.04/release/
<ogra_> as i told you before 
<ogra_> ubuntu-core is *NOT* a root filesystem to boot from
<ogra_> i pointed you to the right rootfs and also told you wheer to find a config in there to compare to your kernel
<ericbutters> where can i find *A* ubuntu for arm to boot from?
<ogra_> <ogra_> http://cdimage.ubuntu.com/lubuntu/daily-preinstalled/20121008/quantal-preinstalled-desktop-armhf+ac100.tar.gz has a lubuntu tarball ... 
<ogra_> <ericbutters> orga_ thank you.. i will try.. did you read my first post regarding mounted-proc?
<ogra_> <ogra_> after untarring run: touch <dir or mountpoint>/var/lib/oem-config/run
<ogra_> <ogra_> ericbutters, most likely you are missing config options,. the tarball is originally for the ac100, look in /boot/ for the configuartion file and compare it to your config options
<ogra_> repatesd from #ubuntu-devel
<ogra_> *pasted
<ogra_> i wont repeat myself again
<ericbutters> orga_ okay.. i try that one.. 
<ericbutters> sry ogra_
<jodh> ericbutters: another thing - if you haven't already created one, you'll probably want to create an upstart job that starts a getty on /dev/ttySAC1.
<ogra_> yeah
<ogra_> see the serial howto on the ubuntu wiki
<ericbutters> okay
<ogra_> it describes the process to set serial console up
<ericbutters> jodh ogra_ wow. i created ttySAC1.conf and added ttySAC1 to securetty.. and now i got a log in. sry, but what is the login name and passwd?
<bfallik> upstart 0.6.5 on el6:  what's the recommended way to restart a process when any instance of another job has restarted (most liked due to a crash)?  Can I specify a pattern in the "start on" and "stop on" clauses?
<bfallik> Hmm.  maybe the instance job name without any INSTANCE= will work?
<bfallik> yes, that seems to work.
<SpamapS> bfallik: glad we could help ;)
<bfallik> hehe.  I'm still not 100% certain of the right way to do what I want, but at least I have my answer.
<SpamapS> bfallik: note that upstart won't emit events, as far as I know, for a respawn of a service... so it would have to be the service dying, upstart not respawning (or giving up) and changing the goal back to stop.. and then an admin or other process starting it again.
<bfallik> SpamapS: Interesting.  That doesn't match what I've observed.
<bfallik> we have respawn set in our worker job, and the webserver job has:  start on starting worker; stop on (stopping worker or stopped worker)
<bfallik> it seems to DTRT, although I'm not expert enough to know why.
#upstart 2012-10-12
<diverdude> i made this configscript: http://bin.cakephp.org/view/445950409 and saved it in: /etc/init/nodechatserver.conf. when i run start nodechatserver i get this error messae: start: Rejected send message, 1 matched rules; type="method_call", sender=":1.11" (uid=1000 pid=14091 comm="start nodechatserver ") interface="com.ubuntu.Upstart0_6.Job" member="Start" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 
<diverdude> comm="/sbin/init"). What am I doing wrong?
<SpamapS> diverdude: you can't run start/stop on system jobs as non-root
<diverdude> ahhh
<diverdude> dog
<diverdude> doh
<diverdude> :D
<diverdude> thx
<SpamapS> diverdude: sudo is your friend
<diverdude> yes
<diverdude> that worked
<diverdude> bu
<diverdude> t
<diverdude> when i do sudo stop nodechatserver i get stop: Unknown instance: 
<SpamapS> that means it died
<SpamapS> diverdude: you should note that this is not the best way to switch users...
<SpamapS>     exec sudo -u www-data /usr/local/bin/node /home/bdi/www/myproj/Console/Command/Nodejs/ChatHandler/ChatServer.js 2>&1 >> /var/log/nodejs.log
<SpamapS> diverdude: that creates a PAM session, which can cause issues if the job isn't stopped
<SpamapS> diverdude: which, btw, it won't be, because there is no such event as "shutdown"
<diverdude> SpamapS: i see...what is a better way to do it?
<SpamapS> diverdude: also if you are on Ubuntu 11.10 or later, the job output will be logged, so no need to 2>&1 to a special log.. it will automatically be in /var/log/upstart/name_of_job.log
<diverdude> ah right
<diverdude> im in 12.04
<SpamapS> diverdude: http://upstart.ubuntu.com/cookbook/#run-a-job-as-a-different-user
<diverdude> but it would be nice to have the log in a special file though
<SpamapS> diverdude: also 'startup' is emitted before filesystems are mounted, before the network is up.. WAY too early
<SpamapS> diverdude: you want 'start on runlevel [2345]' and 'stop on runlevel [^2345]'
<diverdude> SpamapS: mmm i see....is that easy to do?
<SpamapS> diverdude: is what easy to do?
<diverdude> SpamapS: to 'start on runlevel [2345]' and 'stop on runlevel [^2345]'
<SpamapS> diverdude: yes, just change the two start on / stop on lines in your file
<diverdude> SpamapS: do you think you could show me an example by modifying http://bin.cakephp.org/view/445950409?
<SpamapS> diverdude: http://bin.cakephp.org/view/445950409
<diverdude> SpamapS: ahhh nice. thanks
<diverdude> SpamapS: mmm should i restart before i can use it?
<diverdude> because when i run it i get this: 
<diverdude> $ sudo start nodechatserver 
<diverdude> nodechatserver stop/waiting
<diverdude> and stop it says this
<diverdude> $ sudo stop nodechatserver 
<diverdude> stop: Unknown instance:
<SpamapS> diverdude: your start is very odd. I would check the log for errors
<SpamapS> diverdude: note that having it in /var/log/upstart/jobname.log will really be easier.. /var/log/nodejs.log is pretty generic, don't you think?
<diverdude> hmm
<diverdude> cat /var/log/nodejs.log is totally empty
<diverdude> cat /var/log/upstart/nodechatserver.log 
<diverdude> cat: /var/log/upstart/nodechatserver.log: Permission denied
<SpamapS> diverdude: sudo again
<diverdude> you mean sudo start nodechatserver ?
<diverdude> i did that
<SpamapS> no
<SpamapS> sudo cat /var/log/upstart/nodechatserver.log
<diverdude> it says start-stop-daemon: unable to stat /usr/local/bin/node (No such file or directory) in the logfile
<diverdude> but this file exists
<diverdude> i can run it manually
<SpamapS> diverdude: interesting
<SpamapS> diverdude: check for sure that there's no type-o
<SpamapS> diverdude: and when you say you can run it manually, are you running just /usr/local/bin/node, or the full start-stop-daemon command?
<diverdude> SpamapS: sorry that was my mistake
<diverdude> it can run now
<diverdude> nodechatserver start/running, process 14555
<diverdude> however still cannot stop it :(
<SpamapS> diverdude: how so?
<SpamapS> diverdude: is it actually running?
<diverdude> hmm no
<diverdude> ps aux | grep 14555 shows nothing :(
<diverdude> ahh i know why
<diverdude> is it possible to run the process from a certain directory?
<diverdude> like if i want to cd /somewhere first
<diverdude> would that by exec start-stop-daemon --start -c www-data --exec cd /home/bdi/www/myproj/Console/Command/Nodejs/ChatHandler/ ; /usr/bin/nodejs -- /home/bdi/www/myproj/Console/Command/Nodejs/ChatHandler/ChatServer.js 2>&1 >> /var/log/nodejs.log    ?
<diverdude> hmm
<diverdude> its not running
<SpamapS> diverdude: yes there is a 'chdir' stanza
<diverdude> even though the output in cat /var/log/nodejs.log looks correct
<SpamapS> diverdude: don't exec cd
<SpamapS> diverdude: 'chdir /home/bdi/www/myproj....' at the root of the charm
<diverdude> SpamapS: i fixed the CD in another way, so thats not necessary after all
<diverdude> SpamapS: but still for some reason its not running
<SpamapS> diverdude: actually for your charm, you don't even need start-stop-daemon, you can do 'setuid www-data' and 'setgid www-data'
<SpamapS> diverdude: does nodejs daemonize?
<SpamapS> diverdude: like, when you run it from the commandline, does it give you back your shell immediately even though it is running?
<diverdude> SpamapS: hmm i think so...cant all programs do that?
<diverdude> SpamapS: i dont know actually
<diverdude> SpamapS: im pretty sure though...these guys: http://kvz.io/blog/2009/12/15/run-nodejs-as-a-service-on-ubuntu-karmic/ demonised it
<diverdude> SpamapS: dont you think?
<SpamapS> *karmic* ?
<SpamapS> diverdude: thats 3 years old now.. ;)
<SpamapS> node has come quite a long way since then
<diverdude> SpamapS: hehe yes...but i dont suppose it has gotten worse?
<SpamapS> diverdude: but if it is dying.. its not upstart killing it.
<SpamapS> diverdude: check /var/log/syslog, you should have something like "init: ... exitted with code 1"
<diverdude> SpamapS: yeah
<diverdude> init: nodechatserver main process (14722) terminated with status 1
<diverdude> SpamapS: what does that mean?
<SpamapS> diverdude: it means it exitted with an error
<SpamapS> diverdude: I'm sure your log will show the error
<diverdude> no
<diverdude> nothing in the log
<diverdude> and this runs just fine if i do it manually
<diverdude> sudo -u www-data /usr/bin/nodejs /home/bdi/www/myproj/Console/Command/Nodejs/ChatHandler/ChatServer.js
<diverdude> thats very strange 
<diverdude> hmm
<diverdude> SpamapS: ^
<jodh> diverdude: Have you looked at the Upstart Cookbook? Specifically, try: http://upstart.ubuntu.com/cookbook/#checking-how-a-service-might-react-when-run-as-a-job
<diverdude> jodh: hmm i tried doing:
<diverdude> user=www-data
<diverdude> cmd="/usr/bin/node /home/bdi/www/myproject/Console/Command/Nodejs/ChatHandler/ChatServer.js"
<diverdude> su -c 'nohup env -i $cmd </dev/null >/dev/null 2>&1 &' $user
<diverdude> and i get: 
<diverdude> su: Authentication failure
<diverdude> is that the reason for it not running?
<diverdude> and is my cmd set up correctly?
<jodh> diverdude: I think you just got that password wrong.
<diverdude> jodh: no
<diverdude> i tried 4 times
<diverdude> SpamapS: are you still there?
<SpamapS> diverdude: I stepped out for a bit, back now
<diverdude> SpamapS: start on runlevel [2345] ensures that service is started after network interface cards are up right?
#upstart 2012-10-13
<SpamapS> diverdude: after netwrok interfaces configured in /etc/network/interfaces ... it doesn't do anything to help with interfaces that come and go via network manager
#upstart 2013-10-07
<iverson0881> Hi, i'm using upstart 1.5 on ubuntu 12.04lts, and i am unable to set file descriptors beyond 4096, which i beleive is set in /etc/dbus-1/session.conf
<iverson0881> i tried creating a session-local.conf file with an increased maximum number, however I'm unable to do get it to be overriden for user jobs
#upstart 2013-10-08
<hro> Hi! Can someone please help me with this question: http://askubuntu.com/questions/355223/limit-the-parallelisation-of-upstart
<hro> I just realized that my question is silly. If the jobs are daemons that never stop, then there is no way for Upstart to decide that they are done.
<hro> Instead, what I need is a way to limit by disk i/o. That is, when disk i/o is high, upstart shouldn't spawn new jobs. It should only spawn after disk activity cools down
<sneak> hi
<sneak> how do i log the output of my job run with upstart (it does not background) to syslog?
<sneak> when i do exec myapp | logger -t myapp
<sneak> it still ends up in /var/log/upstart/myapp
<jodh> sneak: 'exec myapp 2>&1 | logger -t myapp'
<sneak> jodh: i have exactly that
<sneak>         exec /usr/local/bin/nsqd -data-path=/var/lib/nsqd 2>&1  | logger -t nsqd
<sneak> still getting output in /var/log/upstart/nsqd.log and nothing in syslog
<sneak> it's very confusing
<sneak> same with         exec /bin/bash -c "/usr/local/bin/nsqd -data-path=/var/lib/nsqd 2>&1  | logger -t nsqd"
<jodh> sneak: look at /proc/<nsqd_pid>/fd/.
<sneak> 0 is /dev/null, 1 and 2 are /dev/pts/3
<sneak> thanks for your help, btw
<sneak> echo "test" | logger -t nsqd shows up in my logs
<sneak> hrm, it's not showing up in "initctl list"
<sneak> i stopped doing "restart nsqd" and tried "stop nsqd" and "start nsqd"
<sneak> i think i need to get upstart to notice my nsqd.conf
<xnox> sneak: as sudo...?
<xnox> sneak: sudo initctl list
<xnox> sneak: sudo initctl reload-configuration
<xnox> sneak: also try $ init-checkconf /etc/init/nsqd.conf
<sneak> i got it to show up by removing a bunch of lines from the conf
<sneak> i didn't know about init-checkconf
<sneak> and now it's logging to syslog
<sneak> i wonder which one did it
<sneak> there really could be some better logging going on there.  init-checkconf says syntax ok and upstart logs nothing
<sneak> very confusing
<xnox> sneak: hm, you didn't paste full job to us, so it's hard to tell what you had written up.
<sneak> you're right, the program should have told me the error
<sneak> that's why i didn't paste it
<xnox> sneak: full contents of /etc/init/nsqd.conf that is
<ggayan> hey guys, I'
<ggayan> I'm defining a service in CentOS 6.4 with upstart 0.6.5
<ggayan> but when I display the processes using ps
<ggayan> I see two processes instead of one, it seems that exec isn't working
<ggayan> https://gist.github.com/anonymous/76f54edea219eaf26889
<jamescarr> heyo
<jamescarr> can I use usual bash type commands in upstart? like "/usr/bin/foo -e $(baz -d)"
<jamescarr> with bas -d returning something like "239je23d
<jamescarr> so it expands to /usr/bin/foo -e 239je23d
<xnox> jamescarr: yes.
#upstart 2013-10-09
<shutej> hi.  i'm trying to determine whether block-device-added is a method, a hook, or a signal.
<shutej> while reading the cookbook, i see: http://upstart.ubuntu.com/cookbook/#keybuk-events-are-like-signals
<shutej> ^ this link is 404'ing
<shutej> i'm on ec2 and i'm trying to respond to a volume being added or removed by mounting or unmounting.  is this an appropriate job for upstart?
<shutej> thus far i have this: http://pastebin.com/Y4pDMh9u
<shutej> the block device has been added to the system (i can see it in /dev) but upstart isn't running the job
<xnox> shutej: please see $ man 7 upstart-events
<xnox> shutej: for the up to date events on your system.
<xnox> shutej: i think you want events from the upstart-udev-bridge
<xnox> shutej: man 8 upstart-udev-bridge and man 7 udev
<shutej> HOLY WOWZERS!  this man page is golden
<xnox> shutej:  so yeah, you should be able to see "block-device-added" event, which is generated by upstart-udev-bridge and has all the udev variables set, etc.
<shutej> i'm installing the upstart job from cloudinit
<shutej> while simultaneously asking ec2 to attach the volume AFTER it can SSH into the instance
<shutej> i'm wondering if there's a race condition here
<xnox> shutej: try "start on block-device-added" \n "exec env >> /tmp/block-events"
<xnox> shutej: depends which ubuntu release you are running.
<shutej> 12.04
<shutej> .3
<shutej> :-)
<xnox> shutej: ssh test is not good enough, wait for cloud-init to finish (it happens after one can ssh into the system)
<shutej> how would i test for that remotely?
<xnox> shutej: and you want "initctl reload-configuration" to pick up the job (potentially, depends on how instances are available)
<xnox> shutej: well, try to ssh and check for existance of the magic file (it's something like boot-completed, or finished, or sum such under somewhere /var/*/cloud-init/*)
<shutej> so basically i should ssh in from my control script, issue some command that waits for cloud-init to finish
<shutej> and then initctl reload-configuration manually (cloudinit doesn't do that)?
<shutej> and THEN attach a volume
<xnox> yeap.
<xnox> (cloudinit does do reload-configuration automatically, in certain releases, from saucy and up)
<xnox> so in next lts you will have it.
<shutej> thanks for this, it's been about the most helpful 10 minutes of this day.
<shutej> off to read.
<internetpanda> I am running 6.4 and wanted help with an upstart script to run a search daemon for mediawiki. here is my upstart script which doesn't work: http://pastie.org/8389924
<internetpanda> I believe it may have something to do with jave
<internetpanda> java* if anyone can please help it'd be greatly appreciated
<shutej> move respawn outside script
<shutej> for that matter
<shutej> remove script and end script
<shutej> exec will be sufficient
<shutej> stop on ...
<shutej> respawn
<shutej> exec /usr...
#upstart 2013-10-10
<xnox> internetpanda: init-checkconf is your friend. But it looks like you should deltet line 98 and line 14, there is no need to wrap respawn/exec stanzas in "script... end script".
<xnox> internetpanda: also see cookbook.
<arthurdent> hey i'm trying to start a service with upstart (mdm) and the only output I get is "mdm stop/waiting"
<arthurdent> mdm works fine if i just run it, but i can't figure out how to get more debug output from service or initctl or start
<arthurdent> okay i figured out the problem
<arthurdent> /etc/profile contained a line in it "source" but apparently upstart chokes if it's not "."
<arthurdent> why is this?
<arthurdent> obviously it's using sh instead of bash to source profile, but that seems dumb
<MindQuad> your statement makes no sense
<MindQuad> if it was something in /etc/profile it would fail on every upstart job
<arthurdent> MindQuad: well it didn;t
<MindQuad> arthurdent: then it's doubtful it's something in /etc/profile
<MindQuad> a symptom as opposed to a cause
<arthurdent> MindQuad: well
<arthurdent> cat /var/log/upstart/mdm.log => /proc/self/fd/9: 31: /etc/profile source: not found
<MindQuad> so ?
<arthurdent> changing it to . fixed it, maybe a bunch of other stuff wasn't starting up either; it's not so obvious when your display manager isn't running
<MindQuad> that's a specific upstart script - not upstart
<MindQuad> thats the mdm script
<arthurdent> it doesn't call sh anywhere in the script, it just uses . to source /etc/profile
<MindQuad> s o?
<arthurdent> so . executes commands in the current shell
<MindQuad> that's a problem with a specific script, not upstart
<arthurdent> how could only the mdm script be running in sh instead of bash?
<MindQuad> who said anything about running sh ?
<arthurdent> why else would source not work?
<MindQuad> tht's what you'd have to look at
<MindQuad> but it's not an upstart problem
<arthurdent> why are all of these other upstart scripts written for sh?
<MindQuad> what are you talking about "sh"
<MindQuad> why are you making that assumption
<MindQuad> ls -la /bin/sh 
<MindQuad> on your system
<arthurdent> /bin/sh -> dash
<MindQuad> right
<MindQuad> so it doesn't matter then, it's pointing at dash anyway
<MindQuad> so why you are referencing bourne shell I have no idea
<arthurdent> whatever then, so does upstart use dash?
<MindQuad> if that's what the script is written with or the default shell of your init user
<MindQuad> so again, this is a basic shell script failing for one service, which looking at the fact that it's mdm - suggests it's something specific to mint
<MindQuad> so it's not an upstart problem, rather someone has made a scripting error with that script
<MindQuad> so I'd talk to the mint maintainer and ask them to fix it
<arthurdent> is dash not the default shell on ubuntu?
<MindQuad> I think so yes
<MindQuad> not sure why that matters though ?
<MindQuad> or am I wrong that mdm is the mint service
<MindQuad> I thought that was a mint supplied package, or am I wrong ?
<arthurdent> no, you're correct
<MindQuad> ok, so ubuntu's default shell doesn't matter then
<MindQuad> and has no relecence
<arthurdent> I was just wondering if it was a problem that would also occur on ubuntu if someone wrote a similar script.
<MindQuad> if someone writes a bad shell script it will fail on eny distribution
<MindQuad> so "yes" 
<MindQuad> but also the distribution has no importnce here, neither does upstart as someone has just written a bad shell script with a mistake
<arthurdent> is the mistake trying to source /etc/profile from inside the script?
<MindQuad> the mistake is someone has written a shell script with an invalid shell command for the shell you are using
<arthurdent> no, i put that in /etc/profile. i had no idea the mdm upstart script was going to try to source it with dash
<MindQuad> ok, so the problem is you have made a mistake, putting in an invalid command
<MindQuad> remove the command and you're done
<arthurdent> MindQuad: yeah i said that 15 minutes ago and you told me i was wrong
<MindQuad> no, I thought you where saying the "source" command was in the init script
<MindQuad> I miss-understood what you where saying
<arthurdent> you're right, i should have said the upstart script chokes
<arthurdent> and not assume it was upstart itself
<arthurdent> was upstart around when gdm was still used
<MindQuad> yes
<MindQuad> well, I'm not sure when mint moved away from that atually, but I'd assume so 
<arthurdent> i meant on ubuntu, but yeah; i wonder how the script was written for gdm and if it had similar limitations
<MindQuad> limitations ?
<MindQuad> the limitation is you've put in an invalid command
<MindQuad> how is that a limitation, it's just a scripting error
<MindQuad> either way, this isn't anything to do with upstart, so it's not really for this channel,. 
<arthurdent> alright, well thanks for your support. i guess it's a scripting error because the distro i use sources stuff with bash and I didn't realise some distros still used dash
<MindQuad> mint uses dash
<MindQuad> so that's just poor maintenance / packaging
<arthurdent> mint isn't my distro, i just have to support a bunch of computers that run it
<MindQuad> oh, sorry, I thought it was mint because you where running mdm 
<MindQuad> why are you running mdm if it's not mint 
<MindQuad> actually - that's out of scope for this channel
<MindQuad> sorry
<arthurdent> alright, i'm gonna dip, but the answer to your question is that i'm maintaining mdm on about 150+ mint machines, but I don't use mint on my personal machine.
<arthurdent> thanks again
#upstart 2013-10-11
<MugginsM> hi, are there any issues with using LD_PRELOAD in an upstart script?
#upstart 2014-10-06
<jon-erik____> Hi everyone. I'm trying to solve a problem that I am having with an Upstart job conf. I can't seem to specify a multi-line environment variable in an `env` stanza. Does anyone know if doing so is supported?
<jon-erik____> I have an example posted here (http://stackoverflow.com/questions/26221067/newlines-in-upstart-env-stanza)
#upstart 2014-10-07
<tubbo> this might be better for #ubuntu...but on ubu 12.04 what's the best way to make a "master process" upstart init config?
<tubbo> i am running a bg job queue (resque) and it requires 4 workers. i'd like 1 master process to manage those 4 workers, also managed via upstart
<tubbo> the main process, however, i'm forced to put in a pre-start script otherwise upstart fails to track its PID (guess because it doesn't actually have one)
#upstart 2015-10-07
<thesuliban1980> Hello everyone: I am in an initramfs, I stopped there using break=bottom
<thesuliban1980> btw: I am booting via iscsi, which works
<thesuliban1980> how ever in the initramfs I have a little script, that checks, wetter a local disk with a valid filesystem is present, and if yes, I want to boot from that fs
<thesuliban1980> I tried switch_root /newroot /sbin/init 2 which returns could not connect to socket /com/ubuntu/upstart
<thesuliban1980> Anyone has any ideas?
<thesuliban1980> hello dstarh
<thesuliban1980> are you familiar with the switch_root command?
<dstarh> no
#upstart 2015-10-11
<abbaZaba> I am having trouble with an upstart starting. It is supposed to initiate a VPN connection after a usb cell modem connects. It is not starting up on system boot, or ever
<abbaZaba> http://pastebin.com/Yx1qsZt7
<abbaZaba> when I type "start do-vpn" it connects fine
<abbaZaba> why is not firing at system start, after ppp0 is established?
<abbaZaba> it only fires when I manually start it
<abbaZaba> actually that pastebin is slightly off: I did enclose the interface in parantheses 
<abbaZaba> http://pastebin.com/TaaX02CR
<abbaZaba> ???
#upstart 2016-10-13
<discopatrick> can't seem to get upstart to work on ubuntu 14.04. I'm going through some of the solutions here: http://askubuntu.com/questions/62812/why-isnt-my-upstart-service-starting-on-system-boot#71426
<discopatrick> here's my current script https://www.irccloud.com/pastebin/GHW5FzAF/
<discopatrick> doing `sudo grep init: /var/log/syslog` tells me: 'init: Failed to spawn example.dev main process: unable to change working directory: No such file or directory'
<discopatrick> however, if I cd to the chdir directory, it's definitely there. could there be a permissions issue? `setuid vagrant` should mean that i'm the correct user to move to that directory though...
<discopatrick> wondering if i need to wait for the filesystem to be up?
<discopatrick> current state of script:
<discopatrick> https://www.irccloud.com/pastebin/ofnt7UrG/
#upstart 2016-10-14
<AnrDaemon_> discopatrick: You likely need local-filesystems event instead.
<discopatrick> AnrDaemon: thanks, I'll try that
<lanoxx> hi, how does upstart start processes in the user session? I have a process which is an immediate child of `upstart --user` and I need to know why this process is started or where its configured that upstart is starting that process
<AnrDaemon> lanoxx: http://upstart.ubuntu.com/cookbook/
<lanoxx> thanks
#upstart 2017-10-13
<Necrosan> I have a binary (simple dumb worker) that I need to run X amount of times. Individual clients must restart if they die. Can upstart handle something like this?
<Necrosan> If so, how should I be executing it? A for loop or something within my upstart script or do I need to make an actual intelligent script to do the monitoring of processes?
<Necrosan> (Which I guess would negate the purpose of upstart entirely)
<Necrosan> figured it out w/ the worker/workers model setup. pretty slick
<AnrDaemon> Necrosan: You can write two jobs. One master (stater), one the actual worker that runs the binary.
<Necrosan> yeah, that's what I ended up doing
<Necrosan> worked a treat
<AnrDaemon> It's actually in the cookbook, I just don't have it on hand right now.
<Necrosan> I think I might have stumbled upon it after I had already did it.
<Necrosan> Helps to scroll down all the way ;)
<AnrDaemon> :D
<AnrDaemon> After a number of situations like that, I got a habit of reading the manuals at least diagonally before using something new.
<AnrDaemon> Helps get to know the available features. Even if you are not going to use them right now, it somehow gets stuck in the back of your head, and pop when you stubble upon new requirements.
<Necrosan> ye
<Necrosan> Writing C mostly, was a nice break 8-)
<Necrosan> (same problems there re: manuals, but you usually don't notice them until you experience undefined behavior)
<AnrDaemon> Undefined? More like unexpected.
<Necrosan> Ya, prob the more appropriate word
#upstart 2017-10-14
<onefabric> Greetings. How do I receive http requests from a client browser and take POST / GET variables from it?
<onefabric> I understand that 'env' is to be used, but I am finding it hard to figure out what the exact command / words are.
