#upstart 2007-05-15
* Starting logfile irclogs/upstart.log
* netjoined: irc.freenode.net -> kubrick.freenode.net
<BleSS> does upstart is used by default in ubuntu 7.04?
<BleSS> I said because I updated from 6.04 to 6.10 (installed Upstart), and to 7.04 (directory /etc/event.d/ has been deleted)
<BleSS> so I don't know if my system is using upstart
<Keybuk> it is used by default
<ion_> Do you have the packages ubuntu-minimal and ubuntu-standard installed?
<Keybuk> however you may have older or unofficial things listed in sources.list which could have caused its removal and replacement with sysvinit
<BleSS> Keybuk: but I followed all steps correctly to update it
<Keybuk> there could be a documentation bug
<BleSS> ion_: yes, I have both
<BleSS> ah, one thing, it's ubuntu server
<BleSS> I've installed ubuntu anyway, sudo dpkg -l |grep upstart
<BleSS> s/ubuntu/upstart
<BleSS> upstart, upstart-compat-sysv, upstart-logd
<ion_> Does dpkg -S /etc/event.d find anything?
<BleSS> yes, it shows
<BleSS> upstart-logd, system-services, startup-tasks, upstart, upstart-compat-sysv: /etc/event.d
<Keybuk> sounds like you (or something) wiped /etc/event.d by hand
<Keybuk> dpkg -s system-services | grep Status
<BleSS> Keybuk: you have reason, when I updated from 6.10 to 7.04, the script question me about those files
<Keybuk> you modified them?
<BleSS> I choosed 'uptade to maintaner's version' or anything so and it deleted them
<Keybuk> hmm
<BleSS> I don't remember exactly the question but I choosed the most logical
<BleSS> I'll reinstall again to check it
<BleSS> thanks
<cort> BleSS: try doing upgrades inside of the 'script' command
<cort> it keeps a log of everything that happens on the tty
<BleSS> cort: ok, thanks
<BleSS> ok, I'm there, in that question
<BleSS> Configuration file `/etc/event.d/tty2'
<BleSS>  ==> Deleted (by you or by a script) since installation.
<BleSS>  ==> Package distributor has shipped an updated version.
<BleSS>    What would you like to do about it ?  Your options are:
<BleSS>     Y or I  : install the package maintainer's version
<BleSS>     N or O  : keep your currently-installed version
<BleSS>       D     : show the differences between the versions
<BleSS>       Z     : background this process to examine the situation
<BleSS>  The default action is to keep your current version.
<BleSS> *** tty2 (Y/I/N/O/D/Z) [default=N]  ?           
<Keybuk> <BleSS>  ==> Deleted (by you or by a script) since installation.
<Keybuk> is the important bit ;)
<Keybuk> so Y, install the package maintainer's version
<cort> if he said N then wouldn't he get an /etc/event.d/tty2.dpkg-dist ?
<Keybuk> probably, yes
<cort> which doesn't explain why the whole of /etc/event.d was gone
<Keybuk> unless the directory was removed entirely
<BleSS> i choosed that option in the anterior instalation
<BleSS> Y
<Keybuk> dpkg never removes directories
<Keybuk> so somebody did rm -rf /etc/event.d
<BleSS> to update from 6.10 to 7.04 I used: apt-get install update-manager-core && do-release-upgrade
<BleSS> I didn't deleted nothing
<Keybuk> you must have done while on 6.10
<Keybuk> before upgrading
<BleSS> no, I used 6.04 and it was updated to 6.10
<BleSS> so the installation script has deleted /etc/env.d
<BleSS> My steps: from 6.04 to 6.10 ::
<BleSS> sed -e 's/\sdapper/ edgy/g' /etc/apt/sources.list -i
<BleSS> apt-get update && apt-get dist-upgrade && apt-get dist-upgrade
<BleSS> apt-get update && apt-get dist-upgrade
<BleSS> apt-get -f install && dpkg --configure -a
<BleSS> shutdown -r now
<BleSS> From 6.10 to 7.04 ::
<BleSS> apt-get install update-manager-core && do-release-upgrade
<BleSS> so I'm supposed that there is a little bug in the installation script
<BleSS> s/installation/7.04 updating
<Keybuk> I can guarantee that the installation and upgrade scripts do not delete that directory
<Keybuk> I grepped the entire ubuntu source code earlier to check
<BleSS> I've upgraded from 6.04 ubuntu server in Slicehost
<BleSS> and I run all those commands
<BleSS> so if I didn't delete those files...
<Keybuk> grep -r event.d /var/lib/dpkg/info
<Keybuk> capture the output of that and pastebin it
<BleSS> and the most strange is that I use Y to install those files but they aren't installed
<BleSS> Keybuk: http://pastey.net/31022
<Keybuk> random question, do you have an /etc/inittab ?
<Keybuk> if so, can you pastebin that too
<BleSS> yes, it's
<BleSS> http://pastey.net/31030
<Keybuk> ok, that's correct then
<Keybuk> tty2-6 should be missing
<Keybuk> tty1 and control-alt-delete should still exist thoug
<BleSS> ps -ef |grep getty -> tty1-6 are enabled
<AlexExtreme> ah, that reminds me, iirc there was a problem with the migrate-inittab script for someone who was here last week, it seems to have incorrectly changed the tty job files, causing them to have syntax errors and therefore they won't run
<Keybuk> ls /etc/event.d -> pastebin for me
<Keybuk> AlexExtreme: yeah, lots of bugs with that script
<Keybuk> most amusing one - follow the README and make an empty inittab except for the default runlevel, it helpfully disables all the ttys for you on upgrade
<Keybuk> :p
<BleSS> Keybuk: that dir. doesn't exist (/etc/event.d)
<AlexExtreme> heh
<AlexExtreme> the paste containing what it did for him has expired though....
<BleSS> sorry
<BleSS> Keybuk: http://pastey.net/31038
<Keybuk> BleSS: *shrug* looks like you've not got a problem <g>
<Keybuk> what did you say got deleted?
* AlexExtreme tests his event based networking implementation
<BleSS> Keybuk: I don't understand, in the anterior instalation, they were deleted
<BleSS> and when it showed me "==> Deleted (by you or by a script) since installation." I used Y as now
<Keybuk> how did they reappear then?
<BleSS> Keybuk: I say before of re-install ubuntu and upgrade until 7.04
<Keybuk> ?
<Keybuk> you've utterly confused me now
<Keybuk> you installed 6.04, upgraded to 6.10 and then to 7.04 ?
<Keybuk> somewhere along the way, files in /etc/event.d got deleted and then *came back again* ?
<AlexExtreme> <BleSS> and when it showed me "==> Deleted (by you or by a script) since installation." I used Y as now
<AlexExtreme> they came back from that
<AlexExtreme> so they disappeared during the upgrade somehow, then he tried to reinstall them and answered yes
<BleSS> yes, that is it
<ion_> keybuk: Btw, are you going to push your libnih and upstart branches to the public branch any time soon? :-)
<BleSS> AlexExtreme: thanks my english is not very good and I cann't explain me well
<Keybuk> ion_: there's nothing extra in my branches right now
<Keybuk> AlexExtreme: right
<BleSS> thanks!
<Keybuk> so only tty2-6 disappeared?
<BleSS> the questions were only for tty2-6
<ion_> keybuk: I recall you merged the delayed watch functionality. I might remember incorrectly, though. :-)
<Keybuk> I was merging it yeah
<Keybuk> but I never finished that
<Keybuk> (and it's in a separate branch)
<ion_> Ah, alright.
<Keybuk> couldn't work out how it dealt with the "directory tree created or removed" problem
<Keybuk> BleSS: ok, that's correct then
<Keybuk> BleSS: at some point in the past, you or something you used edited /etc/inittab and disabled tty2-6
<Keybuk> BleSS: when you upgraded, it was entirely correct that those were disabled in upstart too
<Keybuk> and you'll get a config file prompt for them
<ion_> Hm, i probably didnt think of that back then...
<Keybuk> (as you would have it we changed /etc/inittab)
<Keybuk> ion_: the remove case is tricky, since you need to free the inotify watch structure, yet hold on to the hash table :p
<BleSS> ok, but I did't edited /etc/inittab, is possible that was changed by the guys from Slicehost
<Keybuk> sure
<AlexExtreme> probably, since slicehost uses Xen, right? they would have disabled the extra ttys since they're irrelavent for Xen and don't even start IIRC
<BleSS> AlexExtreme: yes, they use Xen
<AlexExtreme> brb, testing something
<BleSS> Keybuk: I have reason. I just rebuild my slice (ubuntu 6.04) and tty2-6 are disabled by default
<BleSS> http://pastey.net/31048
<BleSS> s/I/You
<BleSS> s/I have reason/you have reason
<Keybuk> sure
<Keybuk> but they're disabled because your system installer disabled them for you ;)
<Keybuk> that's been modified from the ubuntu default, the tty2-6 lines have been commented out
<AlexExtreme> hence what i said about xen :)
<AlexExtreme> the extra ttys are completely unable to start while running Xen because the extra tty device nodes don't even exist
<ion_> Hm, perhaps there should be a single tty job, instances of which would be triggered by udev for each tty[0-9] . :-)
<ion_> Uh, tty[1-6] 
<Keybuk> that's an interesting alternate approach
<Keybuk> /etc/event.d/getty
<Keybuk> start on tty-added tty1
<Keybuk> start on tty-added tty2
<Keybuk> start on tty-added tty3
<Keybuk> start on tty-added tty4
<Keybuk> start on tty-added tty5
<Keybuk> start on tty-added tty6
<Keybuk> ?
<AlexExtreme> you'd have to wait for stuff like writable filesystem though
<Keybuk> you'd need the "stop on tty-removed $1" thing though
<AlexExtreme> but yes, it sounds interesting
<Keybuk> that's actually much more in keeping with the upstartish way of doing things
<ion_> start on tty-added tty[1-6]  (fnmatch(3) pattern)
<ion_> Could be squeezed to a single line. :-)
<AlexExtreme> talking of waiting for writable filesystem...
<AlexExtreme> i need some way of doing that with my event based networking stuff
<AlexExtreme> since you need writable FS for dhcpcd
<AlexExtreme> that would be possible with complex-event-config, right? i mean for now i can just loop until the FS is writable
<Keybuk> ion_: I keep forgetting upstart uses fnmatch for those :p
<Keybuk> why does dhcpd need a writable filesystem?
<ion_> Actually i didnt remember whether it does or not, i thought if it doesnt, heres a suggestion for a feature as well. :-)
<AlexExtreme> to write it's info files at /etc/dhcpc and the pid file
<ion_> /etc? Evil!
<AlexExtreme> well technically dhcpcd 3 uses /var/lib
<AlexExtreme> but i patched it to use the old paths until i migrate the network utils to use the new paths (which i'm gonna do in a few mins :p)
<Keybuk> the whole "complex event" thing is getting tricky to see through the fog
#upstart 2007-05-16
<Keybuk> yup
<Keybuk> definitely
<Keybuk> after much consideration
<Keybuk> we want to replace tty* with a single instance job :)
<AlexExtreme> what were the reasons for deciding that? (just curious)
<Keybuk> it's just neater and more upstartish
<AlexExtreme> fair enough :p
<Keybuk> solves the "but I don't have ttyN" Xen problem
<Keybuk> start a tty when you get the event for it, combined with other events
<AlexExtreme> ah yeah
<AlexExtreme> so you won't get an event from udev for all the other ttys when using xe
<AlexExtreme> *Xen
<Keybuk> this is actually a really interesting case
<Keybuk> we have a pair of events from udev, ADD /class/tty/* -> REMOVE /class/tty*
<Keybuk> between these, we know that /dev/* exists for a tty-class device
<Keybuk> so we can say that a tty exists, and which tty that is
<Keybuk> and we want the getty job "bound" to that
<Keybuk> ie. each instance refers to one of the underlying devices, and has the information about those available
<Keybuk> but that also needs to be intersected with another sequence of events
<Keybuk> "the period during which a user can login"
<Keybuk> this is a complex calculation based on things like /etc/nologin existing, ldap being running (for local ldap auth), nscd, nfs (home dirs), dirs being mounted, etc.
<Keybuk> and I think that Upstart should be able to calculate this event itself, rather than farming it off to some other process?
<AlexExtreme> yes
<Keybuk> perhaps I need to take lots of mind-altering drugs, and sit in a tent on the beach with a nice fire going, until my spirit guide comes to me and tells me how to do that :p
<ion_> :-)
<AlexExtreme> :D
<Keybuk> scheme interpreter? :p
<JohnFlux> Keybuk: just out of interest, will kdm etc be able to ask for the password etc before the user is able to login
<JohnFlux> Keybuk: since it takes a long time for the user to enter a password
<ion_> (job 'tty1 ((start-on "runlevel [2-5] ") (stop-on "runlevel {0,1,6}") (respawn) (exec "/sbin/getty 38400 tty1")))
<Keybuk> ion_: heh
<Keybuk> ion_: I'd rather like the native jobs to not refer to the runlevels
<ion_> Yeah, i just took a random file from my current /etc/event.d and converted it. :-)
<Keybuk> JohnFlux: kdm can do whatever it likes ;)
<Keybuk> ion_: the tricky thing is defining how events interact to form states
<Keybuk> you'd probably want dynamic event interaction too
<JohnFlux> btw I was looking at the upstart files
<JohnFlux> it would be really nice to allow you to write     "start after stopping apache"  etc
<Keybuk> ie. "depend on path-mounted ... path-unmounted /usr if getmntent -q -f -d /usr
<JohnFlux> so  using "after" and "before" instead of "on"
<Keybuk> JohnFlux: the whole start on/stop on thing is likely to be changing for 0.5
<Keybuk> so the new language may be nicer
<JohnFlux> "after stopping" and "before starting"  is much more readable than "on starting"
<JohnFlux> oh okay
<Keybuk> "after" has semantic meaning though
<Keybuk> do "after starting apache" things get run after those things with "on starting apache", etc.
<Keybuk> (and we also have planned temporal events, e.g. start 10m after starting apache")
<ion_> start 1m before startup
<Keybuk> ion_: a proposed implementation on my desk by 9am, please
<Keybuk> ;)
<ion_> :-)
<Keybuk> (actually, that would be easy to implement -- you'd delay startup by 1m)
<ion_> Hehe, yeah
<dg> what's the recommended way to run something as a different user from an upstart script?
<mbiebl> dg: upstart doesn't implement that functionality yet.
<mbiebl> So you have to use "su"
<dg> ah
#upstart 2007-05-17
<Keybuk> *yawn*
* Keybuk had some interesting thoughts today
<AlexExtreme> oh?
<Keybuk> so the problem I've been having is trying to understand how to define when a job is running
<Keybuk> and also define for instance jobs when instances are spawned and destroyed
<Keybuk> which involves quite complex combinations of events
<Keybuk> and I've been increasingly wondering whether events are the right things to track, and whether we should instead deal with states
<Keybuk> e.g. rather than "initctl emit tty-added tty1", you'd "initctl set tty-exists tty1 true" or something
<Keybuk> (since then jobs would become just lists of and/or around states)
<Keybuk> but after some thought, I've decided against that
<Keybuk> because we are really receiving events, and trying to fob off turning them into states to the emitter is a bit crap
<AlexExtreme> right
<Keybuk> so having decided that upstart should still receive events
<Keybuk> that means upstart has to deal with turning events into states
<Keybuk> and so far I've been trying to define these states through Job
<Keybuk> this, I think, is wrong
<Keybuk> instead I think we should make State a first class
<Keybuk> and have a way to describe a State, with reference to one or more Events
<Keybuk> which means Job would just make reference to a State in which it was running
<Keybuk> then instance jobs could optionally just have two State *, one for when instances exist, and the other for when those instances are running
<Keybuk> e.g. the getty job
<Keybuk> instances exist for each state tty-added ... tty-removed for a unique $TTY
<Keybuk> and those instances are *running* for the "user can login" state (defined elsewhere)
<Keybuk> this makes Job rather simpler
<AlexExtreme> sounds good
<Keybuk> in fact, I'm considering splitting Job up a bit more, so that the dealing with instances and replacement jobs is at a higher level clas
<Keybuk> at the very least, we'd have Job -> State -> Event
<Keybuk> and we have a good grip above on how to define State
<ion_> Sounds good indeed.
<Keybuk> it's a combination of periods of events
<Keybuk> each item has an Event to be matched, and a pointer to the the EventEmission that matched it
<Keybuk> events on the right-side of the period should be able to reference the emission in the left-side
<Keybuk> e.g.  tty-added tty[1-6]  -> tty-removed $TTY
<Keybuk> this therefore implies that the state has a value at any given time
<Keybuk> which is the environment of any left side not cancelled out by a right side
<Keybuk> so we can pass that on to the job
<Keybuk> once the rhs is filled, we can discard the emission on the left since that needs to happen again
<Keybuk> so we actually just need three pointers, start_event, stop_event and emission
<Keybuk> and not bother retaining the emission for the stop event, since that just cancels the start one
<Keybuk> we then just need boolean things
<Keybuk> AND, OR, NOT for those structures
<Keybuk> and AND and OR for the start/stop event trees
<ion_> Fever ftw.
<Keybuk> the thing causing me difficulty is
<Keybuk> - telling a job which events happened in the tree
<Keybuk> - positional arguments
<Keybuk> any thoughts?
<AlexExtreme> nope, sorry. my brain isn't working too good today
<AlexExtreme> i'll have a think about it though
<Keybuk> the only thing I could come up with was
<Keybuk> - walk the tree in-order
<Keybuk> - for each open state, push the event name into the list, and its positional arguments
<Keybuk> - then pop the first event name, place in UPSTART_EVENT
<Keybuk> so UPSTART_EVENT is the first event at the top of the tree
<Keybuk> $1..$n are the arguments to that event
<Keybuk> followed by "--" followed by the name of the next event, and that ones positional arguments
<Keybuk> quite programming intensive
<Keybuk> but I suspect it won't be a problem, since the only things caring will probably be tasks or state-based instances
<Keybuk> and those will have only one or two events in their list
<Keybuk> so for most people, $UPSTART_EVENT and $1...$n will be sufficient
<Keybuk> e.g.
<Keybuk> block-device-added ... block-device-removed $1 or partition-added ... partition-removed $1
<Keybuk> sounds ok?
<AlexExtreme> yes
<Keybuk> we'd probably end up needing separate files to define states in
<Keybuk> maybe just /etc/upstart.conf or something
<Keybuk> and obviously name them
<Keybuk> and since jobs are now tied to states, not events, we'll have to rename /etc/event.d :p
<AlexExtreme> rename it? shit. :p oh well, i suppose i can rebuild my entire upstart repo... ;)
<Keybuk> lol
<Keybuk> it's always been a temporary name
* Keybuk has never liked it
<AlexExtreme> how about 'upstart.d' ? :)
<AlexExtreme> jobs.d?
<Keybuk> I'd been trying to avoid using "upstart"'s name in its config files
<Keybuk> it may be inevitable though
<Keybuk> I wanted /etc/init.d ... but someone already used that
<AlexExtreme> i would say init.d
<AlexExtreme> heh
<AlexExtreme> but it's used already ;)
<Keybuk> likewise /etc/rc.d
<Keybuk> (but then rc.d is kinda old)
<AlexExtreme> frugalware still uses rc.d for it's sysv stuff (but we were originally based on slackware, so... ;))
<AlexExtreme> hmm :) there's a response from Mike Saunders (an LXF writer) on that post you made @ your blog
<Keybuk> yeah I saw
<Keybuk> I disagree with him
<Keybuk> I think that the point of printed magazines is to have a single line of opinion
<Keybuk> an editorial direction
<AlexExtreme> me too
<Keybuk> otherwise what do they give us that the online press doesn't?
<AlexExtreme> right
<AlexExtreme> there's one thing that's been annoying me with LXF recently
<Keybuk> what's that?
<AlexExtreme> they've been reviewing beta releases as the final product, and only mentioning in small print that it's the beta
<Keybuk> their time-to-print seems extraordinarily long
<Keybuk> I've noticed that before with them
<Keybuk> their NEWS is amazingly out of date
<AlexExtreme> yeah
<Keybuk> could have /etc/service.d /etc/task.d and /etc/state.d
<Keybuk> bit overkill though
<AlexExtreme> yeah
<Keybuk> why is it always ".d" anyway?
<AlexExtreme> i prefer a central location rather than files dotted in a few directories over the place
<AlexExtreme> dunno, i've always wondered that
<Keybuk> difficult to google for ;)
<Keybuk> it seems to have stemmed from when a file was turned into a directory
<Keybuk> /etc/rc -> /etc/rc.d
<AlexExtreme> probably the .d stands for directory
<Keybuk> and it vaguely implies that if you concatenated all the files together, it's equivalent to just having a single file
<Keybuk> which means that the /etc/event.d use would be "invalid"
<Keybuk> since the name matters
<Keybuk> but then the same is true for /etc/pam.d
<AlexExtreme> and dbus' system.d
<Keybuk> we do need to separate out jobs and states though
<Keybuk> maybe
<AlexExtreme> btw, will the replacement-initscripts spec *definitely* get implemented for gutsy?
<Keybuk> no
<Keybuk> it's strongly possible though
<Keybuk> the only thing standing in the way is this complex event config problem
<AlexExtreme> well, if you need any help with that just ask, i'll try to help with decisions if i can
<Keybuk> see above ;)
<AlexExtreme> :)
#upstart 2007-05-19
* Starting logfile irclogs/upstart.log
<keir> how long until upstart makes a difference in boot time?
#upstart 2007-05-20
<Keybuk> refactoring is such great fun
<ion_> Heh
<AlexExtreme> why's that? :)
<Keybuk> cleaned up event.c a little bit
<AlexExtreme> cool
<Keybuk> got rid of the evily named EventEmission structure
<Keybuk> (that's now just Event)
<Keybuk> (and what was Event is now EventInfo)
<Keybuk> also added some ref-counting stuff, so we can keep Event information around after it's been handled (since it populates environment, etc.)
<Keybuk> http://codebrowse.launchpad.net/~keybuk/upstart/main/revision/scott%40netsplit.com-20070520120917-6yanaj1t0a1ej3zd?start_revid=scott%40netsplit.com-20070520121451-6273as3mqxmumuai#init/job.c
<ion_>          * should be releaed and the event should be freed.
<ion_> test_event.c
<Keybuk> :-)
<Keybuk> next thing to figure out is what the difference between Jobs and States means
<Keybuk>  * should they be configured in different directories?
<Keybuk>    or should they be the same, just without processes specified
<Keybuk>    - if different, how do we avoid name clashes?
<Keybuk>    - if the same, how do we prevent "start STATE" from working?
<Keybuk>      and what happens if you turn a file from a job to a state or vice-versa?
<AlexExtreme> if it's the same, can't you prevent start STATE from working by having init work out whether it is a state, and if it is chuck back an error and bail out?
<AlexExtreme> or is it not possible to work out?
<ion_> Perhaps the use cases should be considered to determine that.
<ion_> That is, what Keybuk said.
<Keybuk> what I want to avoid is having the entire Job structure around for a State
<Keybuk> otherwise, what's the difference?
<Keybuk> I can see two easy ways to do that
<Keybuk> one is to have a states hash, as well as a jobs hash, and have something evil in cfgfile.c that returns State instead of Job if there's no processes configured, etc.
<Keybuk> but you'd then have to look in both hashes all the time
<Keybuk> the other way would be to get rid of the jobs hash
<Keybuk> instead have a "registry"
<Keybuk> that'd probably have several levels
<Keybuk> 1) configuration directory (e.g. /etc/??, ~/.??, etc.)
<Keybuk> 2) filename
<Keybuk> 3) state or job found there
<Keybuk> and hash at (3)
<Keybuk> that way, a file that defines both a state and a job (ie. an ordinary job) would be able to used as either a state or a job
<Keybuk> but a file that defined just a state could only be used as a state
<Keybuk> also that makes -HUP easy ;P
<Keybuk> and I could move all the "replacement" stuff into that
<Keybuk> (though when do you replace a State file?)
* Keybuk ponders
<Keybuk> I guess the major question is: does it make sense to let sysadmins manually start/stop a "state" ?
<Keybuk> e.g. if you've defined "user-can-login" as a state
<Keybuk> (or writable-filesystem, filesystem-and-networking, etc.)
<AlexExtreme> i don't think it makes sense, really. they aren't processes, so you should really be able to start/stop them. and if you have a case where a state hasn't really been reached, yet the sysadmin still starts it, it could cause some problems
<AlexExtreme> so in the long run it'd be less problematic, IMO
<ion_> I cant think of a state a sysadmin would need to start or stop manually. I cant think clearly with this flu in addition to my usual symptoms, though. :-)
<Keybuk> hmm
<Keybuk> so better question, should you be able to have a pre-start and/or post-stop script for a state?
<AlexExtreme> hmm
<AlexExtreme> i'm not sure...
<AlexExtreme> i can't really think of a use case for that
<ion_> How about having a process ping a remote host every once in a while and set a network-reachable state based on the pong?
<AlexExtreme> at the moment we can create a job without a main process, just a pre-start and post-stop. are those states or are they still jobs?
<Keybuk> exactly
<Keybuk> use case: runlevel-2 state that sets utmp on the way in?
<AlexExtreme> hmm
<AlexExtreme> yes
<Keybuk> user-can-login state that removes /etc/nologin on the way in, touches it on the way out?
<AlexExtreme> yep
<Keybuk> I can think of examples that are "nice"
<Keybuk> and can't think of any counter-reasons why it should be forbidden
<ion_> Yeah, definitely.
<AlexExtreme> yep
<Keybuk> which means that "State" would need the same internal state machine as "Job"
<Keybuk> along with the ability to define processes, and their environment
<Keybuk> so the difference between a state and a service is purely semantic
<Keybuk> that makes things much easier, since it answers the questions like how to decide when to replace a state definition with one from an updated config file
<ion_> Defining states just as jobs without a main process follows the KISS principle.
<Keybuk> yeah
<keir> i have a possibly rude question: how long until upstart begins shrinking boot time via parallel process start, etc?
<AlexExtreme> it already can do
<AlexExtreme> it'll *probably* be available in ubuntu 7.10
<keir> i don't mind long boots on my desktop, but they are killer on my laptop
<keir> especially since suspend is broken
<Keybuk> it's interesting how hating the first normally co-incides with being affected by the 2nd :p
<keir> heh
<keir> i dream of fresh-install XP SP2 boot times for ubuntu
<keir> now that os boots fast!
<Keybuk> only the first time ...
<cortana> but if you add up all the times you _have_ to boot it, i wonder which one eats a larger chunk of one's life
<keir> true! but i used to run it on my laptop for old games
<keir> i only had FF and the games installed
<keir> i always got very jealous when it would boot up in 15 seconds or so
<cortana> it's a good thing that winodws boots in about 20-25 seconds
<cortana> i have to reboot about 3-4 times ususally to get my keyboard to work
<Keybuk> Upstart's primary goal isn't to make boot faster
<keir> Keybuk, i know
<Keybuk> it's too make it more reliable and robust
<cortana> there is a totally random 75% chance that my keyboard will _not_ work on any given boot into xp :(
<Keybuk> as well as provide more flexibility for what's actually running
<keir> Keybuk, it'd be great if that was a side effect :)
<Keybuk> we just happen to also think it will speed it up
* Starting logfile irclogs/upstart.log
<quitte> hi. has anyone tried compiling upstart using uclibc? I get this error:child.c: In function 'nih_child_poll': child.c:141: error: 'WEXITED' undeclared (first use in this function) WNOWAIT is also undeclared
* Starting logfile irclogs/upstart.log
<quitte> now I'm getting undefined reference to `inotify_add_watch. do you happen to know what is missing in uclibc for that,too?
<Keybuk> sys/inotify.h
<quitte> hmm. that should comefrom the kernel, not uclibc?
<Keybuk> the libc still has to define the syscall
<quitte> ah
<quitte> it's already there. what is this nih thing?
<Keybuk> it's the standard library that upstart uses
<Keybuk> like glib, or something
#upstart 2008-05-12
<Keybuk> that'll be the last thing I do :-)
<sadmac> Keybuk: I haven't crashed it yet. only interesting thing I've done is create 1000 jobfiles at once
<Keybuk> did it work and load them all?
<sadmac> Keybuk: they all got loaded. Seemed to take a second to state such in the terminal
<Keybuk> probably just the terminal ;)
<sadmac> could be
<ion_> I really wish terminals were better with that. IMO a terminal should *never* cause an application printing text to block.
<ion_> And a terminal should skip stuff when needed.
<sadmac> ion_: eew.
<sadmac> I don't want information going missing unexpectedly
<Keybuk> ion_: it only blocks the app if the app using blocking io for stdout ;)
<ion_> Sorry, i wasnât clear. Text going to the buffer and the buffer being rendered should be two separate things, where the the rendering part could just pause for a short while when itâs too slow.
<Keybuk> isn't that what happens mostly now?
<Keybuk> it doesn't really matter either way
<ion_> Well, something like that, yes, but still ruby -e '10000.times { puts "bar" }' is *much* slower than the same with >/dev/null
<Keybuk> what if you set it non-blocking?
<ion_> Then the write calls seem to fail with EAGAIN. I was unclear again: a terminal can cause the write to block as long as it takes to update the *buffer* (should be fast), but the *rendering* of the buffer to the screen should not cause it to block.
<Keybuk> why not?
<Keybuk> what if it was rendering a prompt which the user needed to respond to within a few seconds?
<Keybuk> printf ("Press ^C within three seconds\n");
<Keybuk> sleep (3);
<Keybuk> your suggestion would break that ;)
<ion_> No, it wouldnât. The prompt might just come to the screen sooner. :-)
<Keybuk> it'd come much later
<ion_> The render code would attempt to always show the newest possible state of the buffer, lowering the update rate a bit if the rendering was lagging.
<Keybuk> how can you show the newest state without rendering the previous state?
<Keybuk> terminal codes and all that
<ion_> All that would be handled within the buffer, which is a non-rendered representation of the state.
<Keybuk> it seems like a needless optimisation
<ion_> The slow part seems to be rendering vector fonts with pretty antialiasing.
<Keybuk> terminals like vte already only render the current buffer state
<Keybuk> and they still noticeably slow it down
<ion_> Well, it still happens that you may have to wait ages for an application to receive a ^C if itâs printing a lot of stuff quickly.
<Keybuk> but the printf won't unblock yet
<sadmac> I've seen ruby display some interesting buffer properties lately
<sadmac> I had an app that I wanted to print a . at every iteration of a loop
<sadmac> I got no output until the app terminated, then I got all the .s at once
<Keybuk> that's just line buffered output
<sadmac> oh. Didn't know that line buffering applied to output. I thought that was input only
<sadmac> guess it makes sense though
<Keybuk> can apply to any fd
<Keybuk> stdout is line buffered by default
<Keybuk> as is stdin
<Keybuk> but stderr isn't
<sadmac> $stdout.flush would have taken care of it I'm guessing.
<sadmac> Keybuk: is there a way to manually trigger events in trunk? or do we just have to wait for initctl?
<Keybuk> you get a debug event when it starts
<Keybuk> and events for each job that you start as a result
<sadmac> ah
<Keybuk> which should be enough to set up any number of tests
<sadmac> Keybuk: ahh
<sadmac> Keybuk: so was there still a wire protocol for backup when the dbus service is unavailable, or was it that you use peer-to-peer dbus for this situation?
<Keybuk> peer-to-peer dbus
<sadmac> ah
<Keybuk> connect to unix:abstract=/com/ubuntu/upstart
<Keybuk> same objects as if you sent over the system bus to com.ubuntu.Upstart
<sadmac> very good
<ion_> sadmac: Alternatively, $stdout.sync = false
<sadmac> ion_: wouldn't it be sync = true?
<sadmac> Keybuk: is it in any way possible to create an unlimited instance job?
<Keybuk> sadmac: no, can you think of a use for one?
<sadmac2> Keybuk: I was trying to create an unlimited instance job so I could create a job that started on its own starting event and trigger itself an infinite number of times (with horrible results) :)
<Keybuk> well, yes
<Keybuk> that's kinda _why_ you can't do that ;)
<Keybuk> the closest you can come is by having a job instanced on a UUID
<Keybuk> and passing that UUID in the start message or event
#upstart 2008-05-13
<sadmac2> Keybuk: good morning
<Keybuk> sadmac2: morning
<sadmac2> Keybuk: progress continuing steady?
<Keybuk> yeah I have rough versions of the major commands (start/stop/emit)
<sadmac2> sweet
<sadmac2> Keybuk: got bored waiting, so I started writing a web server in C :)
<sadmac2> Keybuk: does the job definition format support custom stanzas?
<Keybuk> no
<sadmac2> for example: X-redhat-boot-icon /usr/share/icons/fubar
<Keybuk> would you want to parse the file yourself, or get it via d-bus properties?
<sadmac2> Keybuk: the former would suffice, but just putting all stanzas beginning with an X- keyword into a hash available from the dbus object would be nice.
<Keybuk> that's doable
<sadmac2> sweet
<blueyed> Hi. upstart/init crashes on me in an OpenVZ container ("signal 9"), when I save a file in /etc/event.d/. This may be related to the backup file vi creates (or the .pysieved.sw? files laying there). Any idea how I could get a backtrace of this? I'm trying to set this up in another container, because this is on my mailserver container..
<Keybuk> it should drop a core in / ?
<Keybuk> actually
<Keybuk> no it won't
<Keybuk> !! 9 ??
<blueyed> init: error.c:255: Assertion failed in nih_error_get: CURRENT_CONTEXT->error != NULL
<Keybuk> eep.
<Keybuk> that should still be signal 6 ;)
<blueyed> This is how vim (and the container) crashes when pressing ":wq"+enter:
<blueyed> "foo"got signal 9
<blueyed>                  exited from VE 12345
<blueyed> "foo" being the filename.
<Keybuk> ah, vim crashed
<Keybuk> is there a /core file?
<blueyed> yes..
<Keybuk> gdb /sbin/init /core
<Keybuk> where
<blueyed> mom.. need to setup the new container first with gdb etc
<blueyed> I guess I need the dbgsym packages for init?
<Keybuk> yup
<Keybuk> upstart-dbgsym
<blueyed> there you go: http://pastebin.com/m693040b3
<Keybuk> upstart 0.3.9 ?
<blueyed> 0.3.9-2, yup
<blueyed> ubuntu hardy, minimal image, in openvz container
<Keybuk> if only gdb could step backwards *sigh*
<blueyed> It happens always when changing the file and saving it anew. I'll try to trigger it down to some certain line(s). Currently it's: http://pastebin.com/m55a7424f
<Keybuk> err
<Keybuk> so, that's basically impossible ;)
<Keybuk> can you gdb init while it's running in openvz?
<Keybuk> ie gdb -p 1
<blueyed> I'll try.. currently the container does not start at all anymore.. I'll look at that core dump and then remove the event file again.
<Keybuk> what's happened is it's tried to parse the file
<Keybuk> and an error has occurred, causing the function chain to end
<Keybuk> but no error is in the stack
<Keybuk> I've just been through the code and can't see anything that returns without first raising an error
<Keybuk> oops, killed the wrong window
<blueyed> Do dot-files and backup file get ignored? (e.g. "foo~" and .foo.swp) - or could that cause a race condition?
<Keybuk> yes
<Keybuk> they're ignored
<blueyed> It failed to start because of an empty file "foo".. had to remove this from outside of the container first..
<blueyed> the bt from that crash: http://pastebin.com/m569cc617
<blueyed> Attaching to process 1
<blueyed> ptrace: Operation not permitted.
<blueyed> ..does not seem to work?
<Keybuk> no, was hoping openvz might let that happen ;)
<Keybuk> would you be able to rebuild the source to upstart inside the openvz?
<blueyed> yes
<blueyed> without any patches?
<Keybuk> apt-get source upstart
<Keybuk> apt-get build-dep upstart
<Keybuk> then cd into the upstart directory and _EDIT_ init/main.c
<Keybuk> comment out (I tend to use #if 0 ... #endif around them) the following lines
<Keybuk> prototypes for all handlers (65-70)
<Keybuk> the pid 1 check (140-147)
<Keybuk> the log redirection (178-179)
<Keybuk> the console fu (185-191)
<Keybuk> signal setup for handlers (213-239)
<Keybuk> the startup event (283)
<Keybuk> also comment out the handler functions themselves (353-567/eof)
<Keybuk> -- 
<Keybuk> that'll give you a version of upstart you can run as an ordinary process ;)
<Keybuk> then build with debian/rules build
<blueyed> "signal setup for handlers (213-239)"?`all nih_signal_set_* lines there? (line numbers do not seem to match)
<Keybuk> not all of them
<Keybuk> the ones that set a local handler
<Keybuk> the ones that set nih_signal_handler have to remain
<Keybuk> they cause the main loop to iterate
<blueyed> ok. Built, 3/17 tests failed.. which might be expected, but I'm trying a clean build, too.
<blueyed> What should I do with the stripped version now?
<blueyed> clean version also fails with 3 tests..!
<Keybuk> I'll worry about the tests later ;)
<Keybuk> ok
<Keybuk> just run it ./src/init
<Keybuk> oh
<Keybuk> just run it ./src/init --debug
<Keybuk> the --debug helps ;)
<Keybuk> you'll get output on the terminal
<Keybuk> (as root, obviously)
<blueyed> ok. then try to recreate the crash? (it's ./init/init btw)
<Keybuk> yup
<Keybuk> oh, yes ;)
<blueyed> well, now the container is gone.. I should have redirected the debug output probably?
<blueyed> ..and I shouldn't have built/modified it in /tmp.. :/
#upstart 2008-05-14
<Keybuk> you lost the container?
<Keybuk> ahh, the running init died?
<blueyed> yes. but patched and build again. what to do?
<Keybuk> hmm
<Keybuk> we need a way for you to be able to crash that one, without losing the container you're doing it in
<Keybuk> one way would be to do something like
<blueyed> well.. I see what gets displayed until the crash..
<Keybuk> ok
<Keybuk> so try that
<blueyed> cfg_create_modify_handler: foo job definition changed
<blueyed> cfg_read_job: Loading foo from /etc/event.d/foo
<blueyed> init:error.c:255: Assertion failed in nih_error_get: CURRENT_CONTEXT->error != NULL
<blueyed> Aborted
<blueyed> got signal 9
<blueyed>             exited from VE 12345
<Keybuk> did the debug version crash?
<blueyed> how can I be sure? from the core file?
<Keybuk> from the debug output
<Keybuk> it should also asset
<Keybuk> assert
<blueyed> what I've pasted..
<Keybuk> we need the container now to crash
<Keybuk> not to crash
<Keybuk> rm /sbin/init
<Keybuk> cp /bin/bash /sbin/init
<Keybuk> and boot the container that way
<blueyed> well.. it does not start that way.. "init: Failed to open console: Permission denied" isn't a problem, is it?
<blueyed> ..just stops after ~1 sec again, cannot enter
<Keybuk> sorry?
<Keybuk> I don't understand
<Keybuk> what does not start what way?
<blueyed> the container, with bash as init.
<Keybuk> oh
<Keybuk> no idea
<Keybuk> I don't know openvz
<Keybuk> but you need to be running _something_ as /sbin/init that isn't Upstart
<Keybuk> since otherwise every time you trigger the crash, you'll lose the container
<Keybuk> and since I want you to run gdb inside the container while triggering the crash, that won't help ;)
<blueyed> busybox does not work either. But "minit" does.. :)
<Keybuk> heh
<Keybuk> as long as you have something
<Keybuk> once in, start the debug upstart with --debug
<Keybuk> (no need to redirect now)
<Keybuk> and try and trigger the crash
<Keybuk> you should get an assert in its output
<blueyed> "Assertion failed in nih_error_get: CURRENT_CONTEXT->error != NULL", then "Aborted" on a single line
<Keybuk> excellent
<blueyed> I have it started now in gdb.. with "--debug".
<Keybuk> ok
<Keybuk> and does it crash in gdb too?
<blueyed> it crashed right away, when the empty file was not there.. I'll touch it again.
<blueyed> no, does not crash now..?! I've done "gdb ./init/init", then "run --debug".
<Keybuk> ?
<Keybuk> it works under gdb?
<Keybuk> what about under stract
<Keybuk> strace ./init/init --debug
<blueyed> no.. Had done "rm" instead of "touch", sry.
<blueyed> crashes in the gdb session after touching the file, too.
<Keybuk> oh good
<Keybuk> ok, so the next bit is to find out which of the parsing functions is exiting
<Keybuk> this isn't quite easy
<blueyed> do you want access on that machine btw? :)
<Keybuk> if you can give me access, that would be a lot quicker, yeah :p
<Keybuk> if not, we can step through by hand
<Keybuk> sadmac2: great!
<keesj> hi
<Keybuk> hey
<keesj> are there examples of handling a failed emit?
<Keybuk> you know of failure in two ways
<keesj> I have a jobs that itself calls  "stop an_other_job" (the last one fails and apparently also the "stop" command itself return false
<Keybuk> the "emit" command will return a non-zero value
<Keybuk> _and_ a "/failed" event will also be emitted
<Keybuk> is that what you mean?
<Keybuk> or do you mean failed start and/or stop commands?
<keesj> I think I already answerd my own question
<keesj> Keybuk: what is failing is a post-stop script 
<Keybuk> right
<Keybuk> then the stop command will return non-zero
<Keybuk> for the job "foo" (that calls the failing stop command) you'll also have the following event:
<Keybuk>   stopped foo RESULT=failed PROCESS=post-stop EXIT_STATUS=...
<keesj> but I can "if stop my_job ; then you failed ; done" right?
<Keybuk> right
<keesj> any upstart people going to linuxtag btw?
<keesj> thanks
<Keybuk> I wasn't planning to
<keesj> it is far away for you :p
<Keybuk> not so much that
<Keybuk> everyone has the conferences that they go to
<Keybuk> mine happen to be GUADEC and if I can, LCA
<Keybuk> I've never been to FOSDEM or LinuxTag which seem to be another common set
<Keybuk> it's not that I don't want to, just that I never know when they are, and it's too late by the time someone tells me :)
<keesj> :p
 * Keybuk starts bricking his new MP3 player
<Keybuk> hurrah, success
<Keybuk> I now have a USB mass storage-capable OGG player ;)
<Jc2k> rockbox?
<keesj> upstart enabled mp3 player?
<Keybuk> Jc2k: heh, no, just the Korean firmware for the player
<Keybuk> Samsung are strange like that
<Keybuk> Europeans get RDS support for the radio
<Keybuk> Koreans get OGG and UMS support
<sadmac2> Keybuk: how are things progressing?
<Keybuk> anyone would think you were in a hurry
<sadmac2> Hyperactive. Too much television as a kid.
<Keybuk> lol
<sadmac2> Keybuk: well if you consider that, essentially, I'm now paid full time to work on Upstart, and that there's not much for me to do until 0.5 comes out, basically Red Hat pays me to annoy you 40 hours a week.
<sadmac2> which I like :)
<sadmac2> Keybuk: in the process of writing that web server I mentioned, I got sidetracked on some error handling code and ended up implementing lisp-style signal handling in C.
<sadmac2> Could libnih profit from this?
<Keybuk> what's lisp-style signal handling?
<sadmac2> Keybuk: its kind of like exceptions.
<Keybuk> example?
<sadmac2> lemme cook one up....
<Keybuk> http://paste.ubuntu.com/12129/
<sadmac2> sweet
<sadmac2> hmm. crap.
<sadmac2> something suddenly stopped working :)
<Keybuk> hrh
<sadmac2> ahh. I think I figured it out.
<sadmac2> fun with setjmp :)
<xsun> Hi there
<Keybuk> xsun: hi
<xsun> Anyone knows where I can find Scott here?
<Keybuk> that's me
<xsun> Hey Scott, can I pvt you?
<Keybuk> sure, what's uo?
<Keybuk> up
<sadmac2> Keybuk: DCC sending ok by you?
<Keybuk> sure
<sadmac2> Keybuk: sending
<Keybuk> can't seem to connect to you
<sadmac2> Keybuk: email then
<Keybuk> scott@netsplit.com :-)
<sadmac2> Keybuk: you have it
<Keybuk> ah, you're using lngjmp
<sadmac2> Keybuk: only way to do it.
<sadmac2> modulo inline asm
<Keybuk> dpkg does something very similar to this
<Keybuk> you push cleanup handlers
<Keybuk> and errors are raised by lngjmp, which will replay any cleanup handlers
<sadmac2> there's a bit more to this one. There are 3 namespaces for signals. USER (ones you make up for your app) ERROR (allows you to directly throw ENOMEM and the like as errors) and UNIX (literal signals like SIGSEGV)
<sadmac2> you can treat them similarly (the last category might get me into trouble, still investigating it)
<Keybuk> if only C had closures
<sadmac2> Keybuk: GCC has function nesting, which gets you mostly there.
<sadmac2> if only the rest of C had them.
<Keybuk> yeah, but you can't return pointers to them :)
<sadmac2> true.
<sadmac2> You can pass them downward.
<sadmac2> I need to go home
#upstart 2008-05-15
<catsup> um
<catsup> function nesting is totally different from closures
<catsup> in fact the difference between them is exactly what is meant by the word 'closure'
<ion_> He said "gets you mostly there", not "they're equivalent".
<rgl> hi
<TimothyP> Hello, I'm using Ubuntu and I need to start something (an upstart job) AFTER MySQL has started. Someone told me Ubuntu/Upstart only goes to runlevel 2 , can someone verify / explain this? and perhaps tell me how to execute a job AFTER mysql has started?
<sadmac2> TimothyP: start on started mysql
<TimothyP> oh that works already?
<TimothyP> I thought it was to be implemented :d
<sadmac2> TimothyP: well...upstart does it. how ubuntu has upstart set up (i.e. whether mysql is an upstart job) I don't know.
<TimothyP> cool, and how does it know mysql is mysql server, does it use the name in /etc/init.d/  or something else (I need to know the details as I need to explain this to others tonight :p)
<TimothyP> I see
<TimothyP> ok I'll try thnx :d
<sadmac2> the name of the file in /etc/init.d
 * TimothyP is rebooting the vm now to see what happens :d
<TimothyP> nope didn't do anything doh ! :p
<sadmac2> hmm. so mysql isn't getting started, isn't called mysql, or isn't started by upstart directly
<thom> the latter 
<sadmac2> well then that's an issue
<TimothyP> is there a way to list ALL events that are emitted during startup?
<sadmac2> TimothyP: if you could get `initctl events` running early enough that could do it
<TimothyP> hmm perhaps adding a job   on runlevel 2 which starts that and logs to a file
<TimothyP> I'll try
<TimothyP>  if I have on started mysql    for a job  and I /etc/init.d/mysql restart , should that job be executed then?
<sadmac2> TimothyP: ....that makes no sense
<sadmac2> /etc/init.d/mysql shouldn't be runnable
<sadmac2> oh wait
<sadmac2> I'm thinking of event.d
 * sadmac2 facepalm
<sadmac2> TimothyP: anything in /etc/init.d isn't being managed by upstart
<sadmac2> so  you can't react to it
<TimothyP> damn this is very very confusing all the examples come in the form of on started mysql
<TimothyP> :p
<TimothyP> they should have removed the old system all together and 100% upstart instead of all this mixing :d
<sadmac2> TimothyP: if mysql is being started by something in init.d then you can't react to it.
<sadmac2> TimothyP: fedora 9's implementation actually pushes events into upstart from /etc/rc, so it would still work
<TimothyP> in that case that's a bug in ubuntu , if they want to use upstart and keep the old system they should at least link them :)
<TimothyP> what about emiting something custom myself? I could add that to /etc/init.d/mysql then ? is it possible like initctl emit blabla
<sadmac2> TimothyP: yes
<sadmac2> TimothyP: initctl emit started mysql even
<TimothyP> aha and then I'd on blabla
<TimothyP> oh
<TimothyP> and everything ager  emit is a string which should be used then in the on statement?
<sadmac2> yep
<TimothyP> bingo
<TimothyP> that solves everything
<TimothyP> thank you
<sadmac2> np
<rgl> is fedora using upstart by default?
<AlexExtreme> yes, in fedora 9 it is
<sadmac> Keybcz: why the strange name?
<Keybcz> because I'm in Prague
<sadmac> aah.
<sadmac> Keybcz: I've been playing with refactoring a couple functions in upstart
<sadmac> just for teh lulz
<Keybcz> oh, which ones?
<Keybcz> got a bzr archive I can pull from?
<sadmac> Keybcz: event_pending_handle_jobs. Its broke right now though, so it'll be a minute :)
<Keybcz> oh
<Keybcz> wonderful
<Keybcz> that's the function from hell
<Keybcz> I have about four instances of copy and paste code in the d-bus calls for that
<Keybcz> GetInstance shares some of the code
<Keybcz> Start, Stop and Restart share much of the code
<Keybcz> etc.
<Keybcz> I figured that there should be something that gets an instance from a job class
<Keybcz> and then start and stop functions
<Keybcz> but they still end up sharing the code that builds the environment to get an instance
<Keybcz> so it's a bit messy really
<sadmac> well, I was more doing it for my own understanding, so there might be a better way..
<Keybcz> *nods*
#upstart 2008-05-16
<sadmac> Keybcz: https://code.launchpad.net/~cjdahlin/upstart/sadmac
<sadmac> New event_pending_handle_jobs (with some misc. helpers in tow). It passes the unit tests
#upstart 2008-05-17
<sadmac> how do I commit a merge?
<sadmac> in bzr
<sadmac> nvm.
<catsup> does upstart need to have pid 1?
<darius12> I wonder how upstart could solve the "boot splash problem". If there is no goal, how can a "percentage" be calculated? 
<darius12> Some sort of "spinning" is the only UI solution that seems to make sense
<darius12> you could also have some sort of "icon parade" in the lower part of the screen so that you can get a sense of what has already started
<darius12> I can't build current upstart trunk :-(
<darius12> I did the ../nih/nihify && autoreconf -i && ./configure && make dance
<ion_> I donât think it would be very difficult to estimate the percentage based on previous boots.
<darius12> yes but what will define the "100%" in order to calculate this percentage? when X started?
<ion_> For instance, yes.
<darius12> but that can happen at different times depending on the situation (e.g., a usb drive is plugged or not)
<ion_> Yes.
<ion_> As i said, estimate.
<darius12> and when this estimation underestimates? you return the bar back?
<darius12> or do you take something like the 200% of the estimation just to be sure?
<ion_> No, just let it stay at 100%.
<darius12> hmm, if it stays at 100% for long the user might think the system is stuck
<ion_> The probability of that happening is low. Itâs more likely it stays at a much smaller percentage (e.g. waiting for a device or network), at which time the bar could be replaced with a spinner until thereâs progress again.
<darius12> and there is also the question how much do you increment the bar for each "started" events?
<ion_> Thatâs based on previous boots.
<darius12> but since things start in parallel it is unlikely you can estimate that correctly (at least without a lot of samples)
<ion_> I said previous boots. Thatâs where we get a lot of samples from.
<ion_> If there isnât enough certainty, just show a spinner and collect data.
<darius12> So it is a spinner in the beginning and at some arbitrary boot it is transformed to a bar?
<ion_> Yes.
<ion_> Probably already at the second boot.
<ion_> And the accuracy will increase after that.
<darius12> interesting
<darius12> ion_: does current trunk build for you?
<ion_> I havenât built it for a while, dunno.
<darius12> I see. It fails to build here sadly :-(
<Keybuk> darius12: what was the result of "make" ?
<darius12> INSTALL_NIH does not appear in AM_CONDITIONAL
<darius12> I added it manually and now it breaks inside libnih
<darius12> *** No rule to make target `../m4/codeset.m4', needed by `Makefile.in'.  Stop.
<darius12> is it possible that I have an incorrect version? I bzr branch'ed from launchpad
<darius12> I have rev 960
<darius12> I 'm trying to build it in ubuntu hardy
<Keybuk> so you checked out trunk
<Keybuk> and you ran autoreconf -i ?
<darius12> first I run ../libnih/nihify
<Keybuk> you nihify'd libnih?
<darius12> and then autoreconf -i yes
<Keybuk> the _correct_ sequence is ...
<Keybuk>   bzr checkout .../libnih/trunk libnih
<Keybuk>   bzr checkout .../upstart/trunk upstart
<Keybuk>   cd libnih
<Keybuk>   autoreconf -i
<Keybuk>   cd ../upstart
<Keybuk>   ../libnih/nihify
<Keybuk>   autoreconf -i
<Keybuk> ie. you nihify _upstart_ rather than libnih
<Keybuk> if you do it inside libnih, it'll likely futz things up
<Keybuk> so you'd need to checkout again
<darius12> I did it within upstart's dir
<Keybuk> did you do the above sequence?
<darius12> but I didn't autoreconf libnih before I do that
<Keybuk> ah
<darius12> so I 'll try again
<darius12> If it works could you please just copy & paste the above snippet in HACKING?
<darius12> I missed the "autoreconf -i" part inside libnih in the current instructions
<Keybuk> yeah, I probably should
<Keybuk> http://upstart.ubuntu.com/wiki/CompilingUpstart
<Keybuk> has it
<Keybuk> hmm, you may have to configure libnih too
<Keybuk> I can't remember ;)
<darius12> how do you build it?
<darius12> it would also be nice then if there was a standard script for all this dance assuming standard directory names ("upstart" and "libnih")
<darius12> this way you wouldn't forget yoursef :-)
<Keybuk> heh
<Keybuk> It's just always checked out
<darius12> so you just "make" right?
<darius12> ok, I did exactly the above sequence. Now it says: /bin/sh: ../libtool: No such file or directory
<Keybuk> yeah
<Keybuk> try a ./configure in libnih as well
<darius12> ok
<darius12> hmm, no it seems to be building :-)
<darius12> s/no/now/
<darius12> yep, it built fine. thanks :-)
<darius12> would you like me to pastebin the exact sequence so that you can put it in HACKING?
<darius12> well, it's here if you want it: http://pastebin.ca/1021024
<darius12> bbl
#upstart 2008-05-18
<immesys> how do I set up upstart so that the pc shuts down nicely when the power button is pressed?
<EvanR> hlelo
<sadmac> Keybuk: hola
<sadmac> How's prague?
<Keybuk> not too bad
<Keybuk> busy :-/
<sadmac> Keybuk: did you get my message about my branch?
<Keybuk> no?
<Keybuk> did you mail it, or on here?
<sadmac> Keybuk: on here
<Keybuk> ah, IRC is unreliable ;)
<sadmac> Keybuk: https://code.launchpad.net/~cjdahlin/upstart/sadmac
<sadmac> it has my refactored event_pending_handle_jobs
<Keybuk> sweet
<sadmac> Keybuk: also, event.c in latest trunk fails unit tests.
<Keybuk> oh?
<Keybuk> WFM
<sadmac> WFM>
<sadmac> ?
<Keybuk> Works For Me
<sadmac> oh right
<Keybuk> 960 ?
 * sadmac knew that
<Keybuk> what's the failure?
<sadmac> Keybuk: wait....its suddenly ok
<sadmac> :)
<Keybuk> lol
<Keybuk> sounds like there might be a race in there
<Keybuk> I'll keep an eye out
<Keybuk> if you see it again, grab a core file trace out of it
<sadmac> I've been working with dynamic languages too long. I keep compiling things wrong
<Keybuk> "make" ;)
<sadmac> or rather at the wrong times
<sadmac> yeah. I'd have thought
<sadmac> Ah!
<sadmac> There it is again!
<sadmac> ran the wrong one.
<sadmac> Keybuk: test_job_class: tests/test_job_class.c:348: test_reconsider: Assertion `conn = nih_dbus_bus (DBUS_BUS_SESSION, ((void *)0))' failed.
<Keybuk> connection to the dbus session bus failed?
<sadmac> looks like it
<Keybuk> are you running in a usual session?
<Keybuk> or ssh'd into a box remotely?
<sadmac> local session
<sadmac> I'm in a screen session, but I'm at the physical keyboard
<Keybuk> odd
<Keybuk> DBUS_VERBOSE on that one ;)
<Keybuk> ah
<Keybuk> you may need patches to dbus that haven't hit fedora yet
<Keybuk> they're the ones I reported in fd.o bugzilla
<Keybuk> libdbus "forgets" the bus address after the first dbus_shutdown()
<sadmac> hm. lemme go check on that
<sadmac> Keybuk: have bug numbers?
<Keybuk> #15570, #15571, #15588, #15635, #15112
<Keybuk> all of those ;)
<sadmac> Ahh. Most of these were assigned to Havoc. I'll be in the same office as him in a week :)
<sadmac> I will flagellate him until these issues go away.
<Keybuk> lol
<Keybuk> I'm in the same place as DavidKit at the moment
<sadmac> cool
#upstart 2009-05-12
<ion_> keybuk: How certain does it seem for the next generation Upstart to get to karmic?
<Keybuk> ion_: that's the idea
<ion_> Neat
#upstart 2009-05-17
<S11001001> I have a job set to "stop on shutdown", but I need it to be guaranteed to stop before the rc0 or rc6 job starts.  How can I effect this ordering constraint?
<S11001001> For day crew: I have a job set to "stop on shutdown", but I need it to be guaranteed to stop before the rc0 or rc6 job starts.  How can I effect this ordering constraint?
<mbiebl> stop on stopping rc0?
<mbiebl> "stop on starting rc0" might actually be better ;-)
<S11001001> I'll try that, thanks mbiebl
#upstart 2010-05-17
<Keybuk> oops, wrong button
<sadmac> Keybuk: what'd you do? >:(
<Keybuk> Alt+F4'd the wrong window ;p
<Keybuk> am tediously going through gobby saving all the discussions from UDS
<Keybuk> then I have to embarassingly watch all the videos again, and make more notes
<sadmac> Keybuk: DAMNIT! You ruined everything!
<Keybuk> and put that all together into a roadmap
<Keybuk> but, most importantly today, I have to go to the gym! :p
<sadmac> Keybuk: what sort of workout are you doing?
<Keybuk> cardio mostly, including a 5km run
<Keybuk> then basic weights and resistance on the intermediate days
<sadmac> I do karate, but I need to be doing more
<Keybuk> I have a very funny voice
<Keybuk> it doesn't sound anything like it does in my head
<sadmac> You sound british
<Keybuk> I sound squeaky
<sadmac> really?
<sadmac> I don't thin so
<sadmac> When I hear myself recorded its always "Oh god I'm a nerd."
<sadmac> Keybuk: watching your Q&A session finally. So if I want a job to be in manual mode when I boot single user and automatic mode otherwise how do I do it?
<Keybuk> the job would have something saying "while not single user" in it
<sadmac> Keybuk: so its more complicated to have a sort of runlevel analogue for multiple "system states"
<Keybuk> how do you mean?
<sadmac> Keybuk: I can't have one file that defines a "single user mode" and one that defines a headless mode and one that defines the usual mode and one that defines a minimal multi-user mode...
<sadmac> I can't have runlevels.
<Keybuk> you shouldn't need them?
<Keybuk> sorry, not quite following you
<sadmac> probably not. I'm just not excited to explain that to people
<Keybuk> how do you mean?
<sadmac> Keybuk: the way you'd described it at one point there were several "profiles" where you could list the jobs that would be in automatic mode with the rest being manual (or the other way around)
<Keybuk> right
<sadmac> Keybuk: That's much more analagous to runlevels, where you get numbered profiles
<sadmac> Keybuk: I don't know if most sane people would use that additional functionality, but I don't get paid to deal with the sane :(
<Keybuk> both ways should work
<Keybuk> you should be able to define a profile .conf as a list of named jobs
<Keybuk> and you should also be able to inherently define a profile by naming it in lots of jobs (without needing a .conf for it)
<Keybuk> or a mixture of both
<Keybuk> so whichever works better for the distro
<sadmac> Keybuk: doing it with the conventional while mechanism makes life dangerous if you implement the dependency solving thing
<Keybuk> I don't see how
<sadmac> Keybuk: "apache depends on runlevel 5, so start runlevel 5, then start apache"
<Keybuk> fair point
<sadmac> Keybuk: the enable/except thing we discussed is my preferred solution. I may offer the patch later on.
<Keybuk> cool
 * sadmac goes back to grinding on that last nih_parse_tool bug
<gregcoit> ok, in lucid server, how do startup scripts in init.d and init interact?
<gregcoit> ie, if there is a mysql in both....
<sadmac> gregcoit: that's an ubuntu question, not an upstart question, since its entirely dependent on how ubuntu configures upstart
<gregcoit> sadmac: kk - thanks.
#upstart 2010-05-18
<rberger> I am wondering if the following is a bug or a feature:
<rberger> when I start two instances, each one with a different value (via a key) of instance variable "A"
<rberger> ANd then stop one using a specific KEY and it stops both instances.
<rberger> I would have expected only the one with the specified key that matches a specific instance would be stopped:
<rberger> See gist http://gist.github.com/404349
<ion> ${ probably evaluates to either the string â${â or the value of the environment variable {, and A} is appended to that string.
<rberger> If I get rid of the brackiets (ie $A instead of ${A}) it still acts the same and kills both instances
<rberger> (That last message was for ion)
<sigmonsays> ANyone know if upstart can do user-defined conf.d style directories ? ie, does it have a "include" statement? I can't find decent docs on its configuration
<scientes> shit
<scientes> runit cant be configured because runit is not running
<scientes> what do i do?
<scientes> borked upgrade
<scientes> that is the only package i have remaining to configure/upgrade
<scientes> and i think it is what is preventing my system from coming up
<scientes> i have to init=/bin/bash
<scientes> do i try to install sysvinit or something
<scientes> and then runit?
<scientes> sry about that
<rockhound> hi everyone. how do I make upstart recognize my script upon placing it in /etc/init ?
<sadmac> rockhound: if its named something.conf and is free of syntax errors, upstart will pick it up immediately
<rockhound> sadmac: then it must be syntax errors ;-)
<sadmac> rockhound: /var/log/messages should have the errors
<rockhound> sadmac: perfect ... thanks for the hint
<ion> keybuk: http://www.fark.com/cgi/comments.pl?IDLink=5297633&hl=Kim-Kardashian-wants-a-man-who-sees-her-good-qualities-five-lights
<sadmac> THERE
<sadmac> ARE
<sadmac> FOUR
<sadmac> LIGHTS!
<rockhound> pid stanza seems to be unkown in 0.6.3 ... any way that I can pass a correct pid file
<rockhound> hold the answer ... will be back tomorrow ;-)
#upstart 2010-05-19
<rockhound> good day everyone
<Keybuk> rockhound: hi
<rockhound> i am scratching my head on a little issue with a a self-made conf file ... the process started by the script does not apparently fork correctly and it's PID is not detected by upstart ... this means, I can not stop the process with running 'stop initscript'
<rockhound> pid file is apparently not recognized in 0.6.3
<rockhound> any suggestions?
<Keybuk> if you're using "script" and "expect" together, things will rarely work out
<Keybuk> Upstart tends to end up with the pid of cat, grep, or something
<Keybuk> rather than what you intended
<rockhound> okay figured it out now ... one other thing ... I need a pause after executing the process in the script section ... upstarts switches to running state way to early .. inserting a sleep does not work ... is there a clever way of doing such a thing?
<ion> keybuk: http://www.fark.com/cgi/comments.pl?IDLink=5297633&hl=Kim-Kardashian-wants-a-man-who-sees-her-good-qualities-five-lights
<Keybuk> hmm?
<ion> Hint: Star Trek
<rockhound> any hint on how to implement a delay before going into running state?
<sadmac> post-start exec sleep ?
<rockhound> that easy, eh? damn ... thx ;-)
<keesj> Hi, is there a way to see if a process was respawned (in 0.6.3)?
<rockhound> set verbosity level to info and check syslog
<rockhound> initctl log-priority --help
<keesj> and for the process itself?
<keesj> some environement variable perhaps?
<keesj> It looked at the code but I did not look like there was something.
#upstart 2010-05-20
<bilalakhtar> People, I have a problem. I am running lucid. Exim4 starts on boot, I want to stop that, removed runlevel scripts using update-rc.d and still it starts on boot. What do I do?
<saz> cool, this looks like the right channel
<saz> is there a quick way to run upstart jobs as a user other than root?
<saz> I don't want my daemon to have root privileges 
<saz> ..nobody here?
<ion> For now, use su.
<saz> I've been trying that, I'm not sure if my issue is related to using su
<saz> but for some reason, upstart seems to start lots and lots of instances of the binary
<saz> instead of just one
<saz> and stop doesn't work
<saz> (I'm trying to use it to start vncserver, it spawns 99 instances of vncserver, then complains that it can't spawn anymore due to vncserver's limit of 99)
<saz> any ideas?
<saz> right
<saz> looks like I have to put it in the pre-start script
<saz> rather than just the script
 * Keybuk smiles knowingly at Stef Bon's upstart-devel post
<ion> :-)
<ion> saz: What does your definition job look like?
<saz> ion: I think I've fixed it now, but this is what it looks like: http://pastebin.com/JFtQnrUF
<saz> the respawn doesn't seem to work though
<saz> probably because the program is started in pre-start, rather than script
#upstart 2010-05-21
<mshadle> i am trying to create an upstart script... and can't figure out why this one in paritcular doesnt work
<saz> what does it do?
<mshadle> the command is this:
<mshadle>  /usr/local/bin/php-cgi --fpm --fpm-config /etc/php-fpm.conf
<mshadle> that's it. it daemonizes itself by default
<mshadle> if i run it on the command line it works like a charm. but inside of a basic upstart script with exec /usr/local/bin/php-cgi --fpm --fpm-config /etc/php-fpm.conf it doesnt work
<mshadle> i tried adding & for kicks.. i tried fork, respawn, task 
<saz> tried it minus the 'exec'?
<mshadle> doesn't seem to do anything
<saz> have you got the output going to the console?
<mshadle> no.. 
<saz> if so, use xconsole to check for any messages
<saz> console output <- add that line to your script
<mshadle> im downstairs right now. i'll have to go up and look.
<saz> if you've got an ssh session, you can just run xconsole
<mshadle> here i'll let you examine this
<mshadle> http://pastebin.com/z0B2uV7e
<saz> where is your script/end-script ?
<saz> er
<saz> s/-//
<saz> you shouldn't need to fork or the exec
<mshadle> well, does i matter if it is daemonized or not ?
<saz> I have no idea
<saz> but I'd try putting script and end script around it
<mshadle>  /etc/init/php-fpm.conf:12: Unknown stanza
<saz> ?
<mshadle> that's the line without exec prefixing it
<mshadle> let's try the script
<mshadle> no change :/
<saz> http://pastebin.com/fsmKJNw0
<saz> something like that
<saz> I'm not a guru on this, I've only started playing with upstart yesterday
<mshadle> yeah nothing seems to b e working
<saz> I would try replacing your call to the php program with 
<saz> echo "hello world"
<saz> and see if you see hello world in your xconsole
<saz> and take it from there
<mshadle> yeah i just did touch /tmp/php-fpm and nothing
<mshadle> i just made one for nginx, no problem
<saz> oh wait
<saz> /etc/init/php-fpm.conf:12: Unknown stanza  <- you need to quote the whole thing
<saz> http://pastebin.com/wSEMYiQ3
<saz> try that
<saz> or maybe that with exec in front of it
<mshadle> nope.
<mshadle> you do need exec
<mshadle> i know that for sure
<saz> is php-cgi a script?
<saz> I had enormous amounts of trouble with tightvncserver, because it's a script
<mshadle> not working.
<mshadle> no php-cgi is a binary
<mshadle> and it daemonizes itself
<mshadle> there is a script too which could be used but it doesnt work. what worries me is touch /tmp/php-fpm isnt even working
<mshadle> i see the issue. there is some sort of upstart registry or something that has that job blackballed
<mshadle> i made a new random named service and it touched the file no problem
<mshadle> so i bet i have had it working one way.. but it doesn't like my php-fpm service name
<saz> ah
<mshadle> hah. what do you know. i changed the name of the .conf file and now php-fpm2 works
<mshadle> but php-fpm is 'stuck'
<mshadle> i had the right idea the entire time :p
<mshadle> problem is i dont know where the cache/db is
<mshadle> we'll try a reboot. i'll be pissed if it gets stuck on that.
<mshadle> awesome.
<ink> I'm writing my first init script in upstart; is it sufficient for my script to say 'emits foo' to have that signal to be sent after it's up and running, or do I have send from within the daemon itself?
<ink> (via some C code or initctl)
<sadmac> ink: you must send it
<ink> thanks
<sadmac> ink: emits is just for documentation
<ink> this script starts xorg:  http://pastebin.com/UfdU1kZ8
<ink> but `initctl status gui-test` always says stop/waiting
<ink> (never emits the signal?)
<ink> or does post-start not fire until the emit...
#upstart 2010-05-22
<smanek> Hi. Two questions - first, what's the simplest way to get a server to run as a particular user? Second, can I have upstart log output to syslog?
#upstart 2010-05-23
<crankharder> this config, saved in /etc/init/god.conf, doesn't start god on startup - http://pastie.org/973453 -- I even added "start on startup" and nothin -- everything else seems to be fine, starting, stopping, respawning are fine but only after I manually start it myself the first time -- any ideas what i'm doin wrong?
<JanC> crankharder: what version of upstart are you using?
<crankharder> JanC: 0.6.5
<crankharder> I ended up adding "start on (net-device-up and local-filesystems)" to the top of the file and that makes it work
<crankharder> ...i'm not sure both of those are necessary, I just stole the line from the mysql.conf
<JanC> depends on when you want it to start...
<crankharder> if the machine boots into RL2 why isn't it getting started by 'start on runlevel 2'
<JanC> there are no runlevels anymore  ;)
<JanC> they are just faked by events
<JanC> and you did have multiple "start" stanzas
<crankharder> JanC: is that now allowed?
<JanC> no, that's why it didn't work
#upstart 2011-05-16
<maruq> hi guys
<maruq> I've been playing with Upstart today, but having a little bit of fun trying to get it going
<maruq> I'm running Canonical's Lucid AMI, on EC2. trying to write an Upstart job to start our workling client (basically a ruby script)
<maruq> I think I have things right, as per docs & examples, when I start I get:
<maruq> # initctl start livfe-workling
<maruq> livfe-workling start/running, process 2235
<maruq> I then get the status, and it's stopped
<maruq> initctl status livfe-workling
<maruq> livfe-workling stop/waiting
<maruq> is there a log or soemthing I can check?
<maruq> I found: http://upstart.ubuntu.com/wiki/Debugging, now debugging
<maruq> okay, managed to get it running, but it seems to go through weird statuses
<maruq> I'm seeing start/post-stop, then start/running, then stopped/waiting. is that normal?
<maruq> okay, got it going. 
<maruq> I had some pid clean-up to do, so the thing wasn't starting correctly.
#upstart 2011-05-17
<elik_work> I've been trying to turn a process not really built to be a deamon (and to which I have no access to source) into one, but wihtout success
<ion> Sounds like fun.
<elik_work> At first, I noticed it didn't like to be untied from stdin/stdout (could not background it without stopping)
<elik_work> So now I start it through screen
<elik_work> it works when I do it simply from the command line
<elik_work> but with an exec from an upstart job, it doesn't
<elik_work> ion: yeah... it kinda is, but it's just so much more fun when it works :)
<elik_work> So I was wondering what was different between me calling "screen -d -m bash -c 'my_command'" from the shell and from an exec stanza
<elik_work> for some reason, it seems like a child creation is failing when my program is launched from upstart :(
<elik> what could cause a program to behave differently depending on wether it's called from command line or from upstart?
<elik> given the same command (screen -d -m sh -c 'blackboxcommand')
<Keybuk> elik: commands run from upstart aren't connected to a tty
<elik> Keybuk: doesn't screen take care of that^
<Keybuk> elik: I always thought screen itself needed a tty
<Keybuk> also commands from upstart are run in a clean environment
<Keybuk> e.g. $HOME is not set
<elik> Keybuk: I do set the needed variables through env stanzas
<elik> Keybuk: as far as tty goes, I do start services like that using init.d
<elik> screen -d -m detaches and creates a daemon
<Keybuk> detaches from what?
<elik> Keybuk: screen exists so you can detech the terminal from under it
<Keybuk> but in summary, there are plenty of things that can cause a command run from upstart to behave differently than one run from a tty
<ion> Btw, tmux start can be done without a tty.
<elik> ion: without going into details, aren't tmux and screen somewhat similar?
<elik> Keybuk: right :(
<ion> Yes, but iâm under the impression the code quality of tmux is generally better.
<ion> Also, tmux doesnât do a a bunch unrelated things, it only tries to do one thing well.
<ion> +of
#upstart 2011-05-18
<Keybuk> my life was so much easier when I worked on computers that would boot any USB key :p
<elik> Is it possible that upstart would limit the creation of child processes?
<ion> elik: Use ulimit.
<iaindalton> in my pre-start script, I have "echo foo starting >/somefile; /path/to/foo; echo foo done >>/somefile", but /somefile only has "foo starting", even though the script's status is stop/waiting, and pgrep confirms foo isn't running. What's happening?
<JanC> iaindalton: probably foo stopped with an error?
<iaindalton> JanC: why wouldn't the next line execute? I'm not using &&
<JanC> upstart runs scripts with "set -e" (basically: stop the script when a command returns with an exit status value > 0)
<iaindalton> ah; is there a way to get at the exit status? The reason I put those echos in was to debug why it was exiting early, since running /path/to/foo from the terminal after the system boots works fine
<iaindalton> and where does foo's output go when started by upstart?
<iaindalton> I'm searching the docs for this info too
<Keybuk> it goes to /dev/null
<iaindalton> ah, output goes to /dev/null
<Keybuk> the exit status of the pre-start script should be in your syslog
<iaindalton> what if I instead have exec /path/to/foo after the pre-start script? Still in /var/log/syslog? And what do I grep, the name of the script? Because I didn't get anything.
<mbiebl> iaindalton: have you tried "console output" ?
<Keybuk> iaindalton: initctl log-priority info
<iaindalton> Yeah, but everything scrolled by too fast for me to tell if it worked. I assume it's in a log file though, just gotta find it.
<iaindalton> Keybuk: what's that? Does nothing for me
<Keybuk> then your syslog must be configured to drop messages from init
<iaindalton> Yeah, looking into that now :-)
<iaindalton> Wait, was I supposed to run initctl log-priority info at the terminal, or stick it somewhere in my startup script?
<Keybuk> at the terminal
<iaindalton> And what's supposed to happen?
<Keybuk> upstart sends more to syslog
<iaindalton> ah, but my script has already quit by the time I log in, so I'd need to run it again, right?
<iaindalton> except when I run it after logging in, it works fine
<iaindalton> well, I messed with syslog, and now I have the message. Thanks for the help
#upstart 2011-05-19
<sveinse> In an upstart config, why would one use the "pid" stanza? It seems upstart is capable of tracking the service's PID without referring to a pid file
<sveinse> (This is for ubuntu natty)
<soren> I don't believe there's been a pid stanza since.. err... a very long time ago.
<soren> Because, as you suggest, upstart keeps track of the service's pid on its own.
<elik_work> is there any way you can control who can start/stop services through upstart?
<Keybuk> through the dbus config
<Keybuk> /etc/dbus-1/system.d/Upstart.conf
<elik_work> so "start some_service" sends dbus signals, and I must allow my user to send those?
<elik_work> under system.d directory even...
<elik_work> I was left with the impression system.d and upstart were "competitors"
<Keybuk> /etc/dbus-1/system.d != systemd
<elik_work> ok, I see
#upstart 2011-05-20
<nibbo> like this guy http://serverfault.com/questions/267016/how-can-i-use-upstart-with-vendor-supplied-startup-programs I have two commands for starting/stopping my service. Is it possible to use upstart for this? I guess it bypasses alot of the nice things with upstart though
<bencc> I'm using "limit nofile 20000 20000" at the top of my upstart script
<bencc> how can I test if this is being set?
<teolicy> Hi. I have an Ubuntu server (10.10) which booted without a runlevel, I'm rather baffled as to why. 'who -r' outputs nothing, and /etc/rcX.d scripts didn't run so I'm missing non-upstart services.
<teolicy> Anyone here knows what could be the cause? Where in upstart / modern Ubuntu (10.10) can I see the default runlevel?
<ion> nibbo: Replied at serverfault
<bencc> I'm using limit nofile 20000 20000 for an erlang server
<bencc> but the "beam" process of the erlang server still has 1024 nofile limit
<ion> Try
<ion> limit nofile 20000 20000
<ion> task
<ion> script
<ion>   ulimit -a >/tmp/ulimit.out 2>&1
<ion> end script
<nibbo> ion: thanks for rocking my socks of!
<nibbo> off*
<nibbo> Now I am just having the problem of wanting to execute the command in a specific directory. Using script blocks, but a simple "cd" before does not seem to work. Any ideas?
<bencc> ion: I don't understand the syntax of the task script part
<bencc> let me dpaste and see if I got it right
<ion> nibbo: init(5), /chdir
<ion> bencc: Just paste all of that to ulimit-test.conf and run âstart ulimit-testâ
<bencc> ok
<nibbo> ion: Please elaborate. I do not quiet get what you mean.
<ion> Let me try it hereâ¦
<ion> Here it added to /tmp/ulimit.out: nofiles              20000
<ion> So it seems to work at least here.
<ion> Could beam apply its own limit?
<bencc> ion: I've increased the limits to all users so I need to remove it first
<ion> % ulimit -n 2000 
<ion> % erl
<ion> 1> os:cmd ("ulimit -n").
<ion> "2000\n"
<ion> Apparently not.
<ion> Do you get ânofiles 20000â in /tmp/ulimit.out when you start ulimit-test?
<bencc> ion: this is what I got: http://dpaste.com/544785/
<bencc> after 'sudo start ulimit-test'
<ion> Alright, Upstart seems to work correctly then.
<ion> And beam doesnât seem to apply its own limit either. Iâm out of ideas.
<ion> Except for manual investigation.
<bencc> maybe beam apply its own limits when it is started by the script in a release
<bencc> what do you mean by manual investigation?
<bencc> it defines number of ports with -env ERL_MAX_PORTS 4096 but I don't see settings for nofiles
<ion> The usual debugging. Running the service from the command line and seeing if it gets a lower limit. Running it with strace -f -o /tmp/service.strace from Upstart and seeing what sets the limit. Adding ulimit -n calls to various places in the code to see at what point the limit gets set.
<bencc> I'll do that
<bencc> the start script has RUNNER_USER=myapp
<bencc> maybe that's changes stuff? because upstart run with root, right?
<ion> I take it the script doesnât start a new PAM session? Because that would most likely affect ulimit.
<bencc> it has:
<bencc> # Make sure this script is running as the appropriate user
<bencc> if [ ! -z "$RUNNER_USER" ] && [ `whoami` != "$RUNNER_USER" ]; then
<bencc>     exec sudo -u $RUNNER_USER -i $0 $@
<bencc> fi
<ion> sudo indeed starts a new PAM session.
<bencc> good than that's the problem
<bencc> can I do it without sudo?
<bencc> because upstart run as root
<bencc> I'm also using sudo in my upstart script which might also be unnecessary 
<SpamapS> upstart scripts run as root
<ion> You could try adding a user-specific entry to /etc/security/limits.conf
<bencc> that works
<ion> which is used by PAM
<SpamapS> so su should be sufficient
<bencc> doing this in upstart make it much more portable
<bencc> that's what make upstart so cool
<bencc> SpamapS: su doesn't start a new PAM?
<bencc> instead of 'exec sudo -u myapp -i myapp start' I need 'exec su -u myapp -i myapp start' ?
<SpamapS> it does with -l
<bencc> SpamapS so what is the correct way to run a script in upstart as another user?
<SpamapS> su is the recommended way, not sure there is a "correct" way
<SpamapS> Its been suggested that a 'user' stanza would make sense.
<bencc> does 'exec su -u myapp -i myapp start' starts a new PAM?
 * SpamapS would prefer it be 'run as [user x] [group y]' to keep the upstart stanzas as imperative as possible
<SpamapS> bencc: I don't know that it actually runs login.. you should test it
<SpamapS> bencc: certainly if it doesn't, and thats what you need.. then maybe sudo is more appropriate.
<bencc> not sure I understand
<ion> Both su and sudo start a PAM session.
<bencc> if "limit nofile 20000 20000" works but a command that run a script as another user starts a new PAM than what's the point with the limit nofile setting
<ion> daemontools seems to come with /usr/bin/setuidgid which might be useful here.
<ion> The daemontools package
<bencc> thanks
<bencc> maybe editing limits.conf is the correct way to do it
<bencc> I just don't know
#upstart 2012-05-15
<marcus> hi all. just a question concerning upstart: if a configuration has been found in /etc/init/ would this always be preferred over classic sysvinit, or should i disable the old sysvinit script after migration to upstart?
<jMCg> Hello Happy people o/~
<jMCg> I have am doing something.. wrong. I did: sudo stop trafficserver and it's hanging
#upstart 2012-05-16
<ajb> re section 4.2.2.1 of the cookbook: what do you actually need to add to enable user jobs?
#upstart 2012-05-17
<steffen_b3> hi
<steffen_b3> can it be that wait-for-state job in ubuntu is broken ?
<jMCg> Hello happy people o/~
<jMCg> What do I do when start/stop $jobname causes the thing not to return? Just hanging in there?
<jMCg> ctrl+c -> status $jobname says killed (pid)
<steffen_b3> try to find whats blocking and kill that 
<jMCg> steffen_b3: how do I do that?
<steffen_b3> ps -ef 
<steffen_b3> check what you can relate to that job
<jMCg> i.galic@panic /var/bwlog % ps -ef | grep -w logstas[h]
<jMCg> root      7300  3648  0 16:27 pts/0    00:00:00 restart logstash
<jMCg> i.galic@panic /var/bwlog % ps -cafe | grep -w 364[8]
<jMCg> root      3648  3647 TS   19 16:15 pts/0    00:00:00 -zsh
<jMCg> root      7300  3648 TS   19 16:27 pts/0    00:00:00 restart logstash
<jMCg> "nothing"
<jMCg> Syslog is also rather silent.
<steffen_b3> what commands are in logstash upstart job 
<steffen_b3> is something of that in ps -ef
<steffen_b3> note i'm also just user like you (just to manage expectations) - this is how i get normally back if i did stupid things in my upstart jobs ;)
<jMCg> steffen_b3: /etc/init/logstash.conf  http://sprunge.us/BHZX
<steffen_b3> no clue then 
<jMCg> How do I reinitialize upstart again?
<jMCg> wow.
<jMCg> The new Ubuntu has a *new* upstart.
<steffen_b3> 1.5 i believe
#upstart 2012-05-18
<bgamari> How does one continue boot from the recovery prompt root shell
<bgamari> or even just get a list of jobs that would start if the boot were to continue
<bgamari> some job is thrashing right after "normal boot" begins
<bgamari> and Upstart refuses to tell me which one it is
<bgamari> even with --verbose
<bgamari> For all of it's nice features, Upstart really sucks to troubleshoot
<bgamari> How does one send SIGINT during boot?
<Terminus-> hello. is there a way to get the value of $DISPLAY on login-session-start? i tried echoing it to a logfile but i'm not getting the display number of the xserver.
#upstart 2012-05-20
<melodie> hi
<melodie> are there specialists of initctl thing here ? I am reading this page: https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/430224 wondering if a solution has been found or will be found. I am not even at the middle of all the comments yet...
<melodie> I am aiming to produce a remix using this page: https://help.ubuntu.com/community/LiveCDCustomizationFromScratch and I have stepped upon the part concerning this initctl bug
#upstart 2013-05-13
<Jordan_U> I just asked thufir_ to come here from #ubuntu because they appear to have a defunct process whose parent is PID 1, which shouldn't be possible.
<thufir_> what you should I about a defunct process owned by init?  
<Jordan_U> Sounds similar to https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1077579 , and I've seen at least 4 other people with the what appears to be the same bug at various times from #ubuntu.
<thufir_> http://pastebin.com/vwfiZKKv    ps -p 12557 -o ppid              if that link works.
<thufir_> that's weird.  I mean, I could restart, but while we're here, what's init?  is that like root?
<thufir_> Jordan_U: oh, how do I file a bug?  bug ....
<Jordan_U> thufir_: Init is the first process run in a *NIX system, and never dies (if init ever dies, the kernel panics and everything stops). Among other jobs, it is supposed to be the parent of all orphaned processes, and reap them whenever they die. PID 1, i.e. init, i.e. upstart appears to be failing at this basic job.
<thufir_> yeah, I was reading about that in man page.
<Jordan_U> thufir_: I don't know if it's best to file a new bug report or say that one of the existing reports affects you too. Hopefully someone here will respond (wait a while, at least an hour). If nobody does, then file a new bug report but mention that it may be a duplicate of https://bugs.launchpad.net/ubuntu/+source/upstart/+bug/1077579 .
<thufir_> Jordan_U: that's ok, no worries.  I'll just reboot.  I'll add a comment to that bug, wrote down the #.  thanks.   I'm all set now, nothing to do.  Just wanted to know if there was something I could do.  
<Jordan_U> thufir_: Well someone here might have a test they'd like you to run.
<thufir_> Jordan_U: ok
 * thufir_ hangs about :)
<Jordan_U> thufir_: Thanks. I've been wondering about this bug for a while, I'd love to know why/how it's happening :)
<thufir_> ok.  hawat.thufir@gmail.com by the way
<thufir_> 12.10 server edition, installed from that and added xubuntu desktop
<Jordan_U> thufir_: Do you use Samba?
<thufir_> nope.  not installed, let me check.
<thufir_> oh, I'm installing chromium-browser, but I'm positive that I don't use samba.
<thufir_> Jordan_U: I do have samba installed!
<Jordan_U> thufir_: There was speculation that the linked bug might be related to https://bugs.launchpad.net/ubuntu/+source/gvfs/+bug/1075923 , but unless you had mounted a samba share via Thunar I think we can rule that out (for you at least).
<thufir_> I'm using thunar...
<thufir_> and have two hard drives.  
<thufir_> but, I have no idea what samba is.  I'll read wikipedia.
<thufir_> I can't imagine why I have samba installed, it's only Linux on this box.  there used to be windows, so maybe it's a holdover.  I'll look into mounting a share via thunar.
<Jordan_U> thufir_: Samba is a very common way to share files over the network, even when you're only sharing among *NIX machines, but you would know if you'd been mounting networked filesystems.
<thufir_> ok, not networked.  just 
<thufir_> Jordan_U: still want me to hang around?
<Jordan_U> thufir_: I guess not. Please do file a bug report though, with the output of "ps aux" and ps -p 12557 -o ppid, and the output of "dmesg" in case there's anything interesting there.
<thufir_> got it.  
<Jordan_U> thufir_: Thanks for taking the time to file a bug report.
<thufir_> lol, what's the command again?
<thufir_> I'm looking at https://help.ubuntu.com/community/ReportingBugs.  i'll let you know.
<chras> so i had a requestion: re upstart environment. 
<chras> if i have a ver pre-defined in my upstart script, ie. env FOO=${some_value}
<chras> and then issue a start with FOO=${some_other_value}
<chras> then the entire lifetime of that execution has FOO=${some_other_value}
<chras> ie, even during a stop
<SpamapS> no
<chras> well
<chras> yes
<chras> thats the case
<SpamapS> that instance will get some_other_value
<SpamapS> stop will destroy the instance
<chras> we're saying the same thing
<chras> once we stop it, i dont care
<chras> im talking about lifetime of start -> stop
<SpamapS> restart will not
<chras> anyways, my question is thus
<chras> is there any way for it to automatically use the predefined value
<chras> UNLESS its specified on cmdline
<SpamapS> ahh yes
<SpamapS> during stop, got it
<chras> so if i doo FOO=bar on cmdline
<chras> i want that to be true in that incarnation
<chras> but if i do a stop later
<chras> can i have to fall back to the predefined value
<chras> instead of preserving the bar
<chras> im my exact case, i pass my event a force flag
<chras> and i wanted to avoid having two force flags
<SpamapS> so start creates an instance of your job
<chras> once for startup, and one for stop
<SpamapS> passing FOO=bar to start makes FOO=bar for that instance
<chras> yup
<SpamapS> stopping that instance, removes all memory of FOO=bar
<chras> can i can overwrite that with stop FOO=something_else
<SpamapS> so a subsequent 'start' will pick up 'env FOO=baz' from the job definition because you did not pass anything to start.
<chras> yup
<chras> know that
<SpamapS> no you can't change environment variables on a running instance
<chras> thats what i figured
<chras> so ill have to two use diff vars
<SpamapS> use a file on disk to affect the post/pre stop scripts
<chras> bleh, have to use two diff
<chras> thats messy in my case, its easier to have FORCE_FLAG_WHEN_STARTING vs FORCE_FLAG_WHEN_STOPPING
<SpamapS> hm
<chras> since when i send my force flag during startup, i dont neccecerily want that set during stop
<SpamapS> stop does list KEY=VALUE in the man page
<chras> so ill just have to disjoint them
<SpamapS> so I may be wrong
<chras> im likely doing a bad job explaining my situation
<SpamapS> no I get it perfectly
<SpamapS> and I think its a valid use case
<chras> youc an do stop VAR=
<chras> and it works fine
<chras> on startup i set a force flag in some situations
<chras> and i ALSO need a force flag in some stop situations
<chras> but thoes are not the same
<SpamapS> ah ok, I think the KEY=value is just for locating multi-instance jobs
<chras> so havign it be global is problematic
<chras> well
<chras> thats if you use the env in your $INSTANCE
<chras> var
<SpamapS> so like when you've done 'instance $FOO' in your job, you can do 'start myjob FOO=1; start myjob FOO=2;stop myjob FOO=1;'
<chras> yup
 * SpamapS is reading the code at this point
<chras> instance can be wahtever you want mind you, ie can be "chris-$var1-$var2-$varN"
<SpamapS> having done some really crazy stuff w/ instance (note /etc/init/wait-for-state.conf) .. I'm fully aware :)
<chras> what i was hoping for was there was a way to say, FOO=${whats_defined_in_the_event_always} UNLESS, its specified on the command line
<chras> so if i did a stop on an event
<SpamapS> http://bazaar.launchpad.net/~upstart-devel/upstart/trunk/view/head:/init/job_class.c#L1060
<SpamapS> chras: comment confirms, args are not passed to the job during stop
<chras> then it would take wht was pre-defined, instead of what was set when it was specified on the cmdline during the start
<chras> sure they are
<chras> May 13 19:12:29 t-nfs04b init: (env_test post-start): Value of CHRIS=[PREDEFINED]
<chras> May 13 19:12:36 t-nfs04b init: (env_test pre-stop): Value of CHRIS=[stopingvar]
<chras> root@t-nfs04b:~# initctl start env_test 
<chras> root@t-nfs04b:~# initctl stop env_test CHRIS=stopingvar
<SpamapS> chras: oh so it does work the way you want. Interesting!
<chras> well no
<chras> thats the expected behaviour 
<chras> if i do this
<chras> initctl start env_test CHRIS=startingval
<chras> and then do ao
<chras> initctl stop env_test
<chras> with NO cmdline
<chras> id 'expect' it to be
<chras> CHRIS=[PREDEFINED]
<chras> instead, its CHRIS="startingval"
<SpamapS> yeah I'm just surprised it is passed into the pre-stop/post-stop
<SpamapS> yeah, but you see now why
<SpamapS> You'd need a special case thing ot initctl, like '--restore-predef' ... seems pretty complicated.
<chras> yup
<chras> so i think, best bet for me, is just to have TWO variables
<chras> one to force things during startup
<SpamapS> or a DEFAULT_FOO and then pass in USE_DEFAULT=1
<chras> and once to force things during stopping
#upstart 2013-05-15
<mkomitee> I understand that 'start on runlevel' will start as soon as we switch to that runlevel. Is there a way to cause a job to start only once all of the services associated with that runlevel have completed?
<SpamapS> mkomitee: unfortunately no, but I have an idea for how to make that happen.
<mkomitee> FYI I'm on rhel6 so I'm running upstart, but there's a lot going on with the legacy sysv init system.
<SpamapS> mkomitee: we need to have things 'start on starting network-services'. network-services would be 'start on runlevel [2345]' .. then you could do 'start on started network-services' to be "after normal stuff"
<SpamapS> mkomitee: for rhel6 you might be able to fake it with 'start on stopped rc RUNLEVEL=x
<mkomitee> any idea what emits that?
<mkomitee> or do all tasks emit something when they complete?
<mkomitee> aha, that appears to be the case, so when rc is finished, it'll emit "stopped rc"
<mkomitee> so I can create a task which will "start on stopped rc RUNLEVEL=[2345]" and it should start whenever all of the services that require it have been stopped/started in the sysv system.
<SpamapS> mkomitee: right, that would work in Ubuntu too
#upstart 2013-05-16
<ajp> anyone around to help with an upstart script?
<ajp> http://pastebin.com/v7GzqKyL here's the script
<ajp> having trouble with upstart: http://pastebin.com/v7GzqKyL here's the script. The subscripts work but the upstart doesn't... I've tried starting and stopping the service with no luck
<ajp> anyone not idling?
<SpamapS> ajp: expect fork may not do what you think it does
<SpamapS> ajp: also 'starting shutdown' is not an event.
<SpamapS> ajp: unless you have a special 'shutdown' job you created
<SpamapS> ajp: If MonitorScannedPDFsMatthew.sh just runs forever and never detaches itself, then remove 'expect fork'
<SpamapS> ajp: and I'd recommend using 'start on runlevel [2345]' and 'stop on runlevel [016]' unless you have a good reason to use something else
 * SpamapS re-idles
<ajp> spamapS: thanks that was a big help, ill try it after I'm done with lunch here
<ajp> SpamapS: nice palindrome, anyways here's what I have now:  http://pastebin.com/ByJeymDR Still not working. should I be using "$sudo initctl start upstartPDF" to start/stop the job?
<SpamapS> ajp: you will need root to start/stop jobs in the default configuration yes
<SpamapS> ajp: you might want to change 'console none' to 'console log' and look at /var/log/upstart/upstartPDF.log for clues
<ajp> good idea
<ajp> it dopesn't look like it's logging 
<ajp> I wouldn't have to restart the system would I?
<ajp> SpamapS ?
<SpamapS> ajp: no, just the job itself
<SpamapS> ajp: if it isn't printing anything out, it won't log
<SpamapS> ajp: you can check /var/log/syslog for any clues as well
<ajp> ic
<ajp> well almost end of workday, I guess i'll be here tomorrow
<ajp> thanks ttfn
#upstart 2013-05-17
<brian_petersen> What is the official way of running a command with another account? (unprivileged user)
<stgraber> brian_petersen: setuid + setgid stanzas
#upstart 2013-05-18
<soren> How does upstart determine if it's being run in a chroot? AIUI, it's meant to start upstart if it's run as root inside a chroot, but that doesn't seem to be happening. Instead it just seems to try to connect to an existing upstart instance (which fails, since it's a chroot on an Android device )
<soren> Oh, is it perhaps not supposed to run a new upstart, but simply allow it to run jobs in the "system" upstart in a contained fashion?
#upstart 2013-05-19
<SpamapS> soren: the latter
<SpamapS> soren: it chroots just before running the bits.
<SpamapS> soren: its somewhat weird, because of namespcae collisions, but reliably weird
<soren> SpamapS: Ok, cool. Just playing around with an Ubuntu chroot on an Android device, thought I'd be able to run upstart inside of the chroot.
<SpamapS> soren: thats been a frustration for a long time. The new user session stuff might make it closer to reality than it was before.
<SpamapS> soren: works fine inside a new process namespace (i.e. lxc)
<MMlosh> hello.   Can I have upstart log   stderr of my program?    My search query "upstart conf log stderr" didn't return anything useful
<ion> Do you have /var/log/upstart?
<MMlosh> let's see..
<MMlosh> it's a directory
<MMlosh> ion, there are some logfiles, but none for my program
<ion> Ok. I havenât really looked at the logging mechanism for /var/log/upstart, but hereâs something else you can do: change
<ion> exec foo
<ion> to
<ion> script
<SpamapS> MMlosh: the default is to log stdout and stderr to /var/log/upstart/$jobname.log
<ion>   exec 2>/tmp/mylogfile
<ion>   exec foo
<ion> end script
<ion> Well, actually just exec foo 2>/tmp/mylogfile would suffice for *that*.
<SpamapS> ion: exec never returns
<SpamapS> oh
<ion> But if you have a script of some kind, add the exec 2>/tmp/mylogfile in the beginning.
<SpamapS> n/m I see thats a redir
<SpamapS> you don't have to do that though
<SpamapS> both are logged
<MMlosh> SpamapS, hmm... why doesn't it, then..  oh.. right.. that machine is ancient, 10.04 and ARM-based. Is it possible that it wasn't the default in the past?
<SpamapS> 10.04 didn't have that feature
<SpamapS> it debuted in 11.10 I think, or 12.04
<MMlosh> sry.. I forgot on which machine it's running..      This one is 12.10, so it should be ok
<SpamapS> upstart 1.5 I think
<MMlosh> yes, I am running upstart 1.5-0ubuntu9
<SpamapS> MMlosh: man 5 init clearly states console log connects stdout and stderr to the logging pty
<SpamapS> MMlosh: note that the log file will not be created until something is printed on those
<MMlosh> my program prints an error with certain probability, so I am not 100% sure that something was printed
<SpamapS> MMlosh: do you have 'console output' or 'console none' or 'console owner' in your job file?
<MMlosh> the .config  is simple "exec /usr/bin/getstream -c $config"
<MMlosh> no, no console configuration
<MMlosh> it has only these: description, start, stop, respawn, respawn limit, umask,    aww crap..  console none
<MMlosh> thanks for hunting it down..  stupid me
<MMlosh> SpamapS, is it normal, that all files in /var/log/upstart/   end ".gz" ?  I expected at least some to be non-gzipped
<SpamapS> MMlosh: its alright, we all need a second pair of eyes sometimes :)
<SpamapS> MMlosh: those are rotated old files
#upstart 2014-05-12
<Outlander> hi
<Outlander> can I have more than one pre-start script?
<Outlander> in an upstart config
<menace> hi, short question.. i recently asked, if i could write a script, which might take a long time. a user here said, that this script may be disrupted/discontinued because upstart has a maximum delay time. 2 Questions: can i modify that maximum delay behavior (trigger it on/off, configure longer time). i asked this for jobs, is this for other types of scripts as well, or is the delay time only hard for jobs?
<jodh> menace: You would need to modify /etc/init.d/sendsigs. Currently, that script will wait for 300 seconds (max)
<menace> hrm, okay. at our current system, it's there. on older versions (0.6.5-8), it is not in the file, but quits after 300 seconds as well. (even if not killed/stopped state). any idea where it hides?
#upstart 2014-05-13
<jay> This is my first time using upstart, my error is initctl: Rejected send message.  Can somebody help?
<jay> https://gist.github.com/JasonMannon/c5eb9012980f6f725a6e
<jay> hey jodh
<jodh> jay: hi
<jay> This is my first time using upstart, my error is initctl: Rejected send message.
<jay> https://gist.github.com/JasonMannon/c5eb9012980f6f725a6e
<jodh> jay: google (and the Upstart Cookbook!) is your friend: http://upstart.ubuntu.com/cookbook/#strange-error-when-running-start-stop-restart-or-initctl-emit
<jay> thank you
#upstart 2014-05-14
<raydeo> has anyone made a working upstart script for nginx? so far I'm unable to find one that tracks the correct pid and restarts correctly
<combusean> hi all
#upstart 2014-05-15
<Jef91> Is there a configure flag that allows upstart to build without tests?
<Jef91> One of the tests is failing in my chroot and I want to just skip them
<Jef91> this bug found my solution -> https://bugs.launchpad.net/upstart/+bug/888910
<xnox> Jef91: if you are building an debian/ubuntu package, you can pass DEB_BUILD_OPTIONS=nocheck to skip executing the test-suite.
<xnox> Jef91: that bug is fixed in later releases.
<Jef91> xnox, that was the option I needed yes
<Jef91> that bug I just linked has that noted in the comments
<xnox> Jef91: a bug report with your full build-log would be helpful, for us to find out if there is an issue with environment, tests or upstart itself as exposed by a particular environment.
<jodh> Jef91: can you also state on that bug which version of upstart you are attempting to build under sbuild?
<detrout> Hi, I'm running debian unstable just figured out that cgroupfs-mount's initscript causes my system to hang while shuttingdown/rebooting.
<detrout> My hunch is the upstart init script is missing a stop trigger
<slangasek> it certainly does seem to be missing a stop condition
<slangasek> which is inconsistent with the init script
<slangasek> (i.e., the upstart job has no stop condition, the init script does)
<slangasek> so yes, this would cause a hang on shutdown, because startpar sees that the init script should be ignored in favor of the upstart job, and stalls waiting for the upstart job to trigger, which never happens
<slangasek> detrout: a one-line change to /etc/init/cgroupfs-mount.conf to 'stop on unmounted-remote-filesystems' should do the job
<detrout> ok.
<detrout> it'll take me a moment to be able to test that.
<slangasek> I'm not sure if it should be 'stop on runlevel [016]' instead - it seems like that could fail if something currently has the mount points in use
<detrout> I installed it so I could try docker.io
<apes> What does having a symlink in /etc/init.d cause Upstart to do? Is it supported behavior?
<apes> EG /etc/init.d/foo -> /etc/init.d/bar
<apes> Also assuming both are listed in various runlevels
<apes> EG /etc/rc.2/foo /etc/rc.2/bar
#upstart 2014-05-16
<jay> Could someone help me with this?
<jay> http://pastebin.com/1cHW5S1y
<jay> when is the .sock file created?
#upstart 2014-05-18
<krainboltgreene> Alright, so I've written a daemon in ruby, and I'm migrating over to upstart (seems smart to do so). I'm wondering if there's anything specific I need to know?
<krainboltgreene> Specific to running ruby scripts in upstart, that is.
<krainboltgreene> Specifically, will I have access to my globally installed gems?
#upstart 2015-05-11
<stereoit> Hello, I am on 14.04 trying to test respawn. Killing process just put it into stop/waiting status even when I have respawn stanza specified. Any hints?
#upstart 2015-05-17
<swiftynb> is there some reason exec /home/ubuntu/test/myexecutable 
<swiftynb> would not keep running?
<swiftynb> with upstart
