/srv/irclogs.ubuntu.com/2013/02/26/#upstart.txt

afournierit happens that when i do a start job or stop job, upstart is waiting for something (it does not give back the shell), the job is in "start/starting" "stop/starting"09:30
afournieris there a way to "debug" this behavior ?09:30
phroddonafournier: increase the debug level (initctl -q log-priority debug, if I recall correctly)09:32
phroddonafournier: I like to strace the upstart job also, it can help a lot09:32
phroddon(for example, put a sleep at the very beginning of the job to have the time to strace it ;)09:32
afournierlike this "strace --someargs start job"09:33
afournier?09:33
afournierha you attach to the pid ?09:33
phroddonyup 09:33
afournierk09:33
afournieri found something when "stracing" initctl 10:43
afournierafter the connect to dbus, and negotiation, it gets a recvmsg(3, 0xbf837c3c, MSG_CMSG_CLOEXEC) = -1 EAGAIN (Resource temporarily unavailable)10:43
afournierand then it waits forever in poll()10:43
afournierany idea ?10:44
afournieri am starting to think that upstart was not a good choice at all12:58
jodhafournier: http://upstart.ubuntu.com/cookbook/#establish-blocking-job13:58
afournierthanks jodh, i really thought initctl was buggy14:05
afourniera warning would be a good idea, dunno if it's possible14:06
afournieri will try this script right now14:06
jodhafournier: it doesn't make sense to show a warning in this scenario as upstart is working correctly - it's simply blocking waiting for the remaining events in your jobs 'start on' to be emitted. If you don't want initctl to block itself (just the job), use 'initctl -n emit ...'14:10
afournierthat's what i was thinking in the first place, but using "start job" and waiting for ever is not natural, because when someone says "start job" it expects the job to start, not to wait for ever14:11
xnoxafournier: that depends, currently one is guaranteed that when `start job` exits with 0 you can rely  on the service be available & hence start using it immediately.14:48
afournierthe problem was on start, not at exit14:51
afournieri was thinking that calling a job with the start command would force it to start, but from what i understood, if the job as something like "start on started other_job" job will wait until other_job has started14:53
afournierto me start was implicit "manual" but it's not14:53
afournieranother option would be to print a warning/notice on CTRL+C, to say job was not started because this condition was not met14:55
SpamapSafournier: start on and stop on are not evaluated when you do an explicit start or stop of a job15:57
afournierso it's like having "manual"15:57
SpamapSafournier: what you're blocking on is *other* jobs that 'start on starting yourjob and xxxxx' .. where xxxxx is something that happens only during boot most likely15:57
afournierah ok15:57
SpamapSafournier: so I would look for other things that mention your job in their start on15:57
SpamapSor stop on15:57
SpamapSafournier: Those other things are most likely "doing it wrong"15:58
afournieri get it15:58
afournierthanks SpamapS15:58
SpamapSafournier: as far as initctl blocking forever.. I am troubled by it too, and have oft thought that if 'initctl --verbose start foo' could say something like 'emitted starting foo\nstarting foo blocked by job bar [start on starting foo and net-device-up]' that would be great16:00
SpamapSafournier: when you have log-priority set to debug, you can see that in syslog.. but.. yeah.. thats a bit disconnected from your terminal16:00

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