/srv/irclogs.ubuntu.com/2010/02/04/#upstart.txt

ionWoot, an implementation of Cucumber for Erlang. That’ll be useful for me. http://github.com/northscale/cucumberl/blob/master/features/sample.feature http://github.com/northscale/cucumberl/blob/master/src/sample.erl18:19
sadmac2Keybuk: suppose I have a job A, and a job B that's start on starting A, and B has post-start exec stop 18:47
sadmac2post-start exec stop A *18:47
sadmac2Keybuk: expected behavior, IMHO, is that B prevents A from starting, and runs instead.18:47
sadmac2Keybuk: actual behavior is not, what are your thoughts.18:48
Keybukthat a bug was filed about that yesterday18:52
sadmac2Keybuk: probably by rstrode notting or plautrba :)18:53
sadmac2Keybuk: I'd have filed it but I thought I might've just been doing it wrong.18:54
* sadmac2 doesn't see it in his launchpad mail18:54
Keybukno, by one of our developers18:56
sadmac2Keybuk: hmm. funny we hit that at the same time.18:57
Keybukmight be in a slightly different way19:00
Keybukbut basically trying to do the same things19:00
sadmac2think B ended up killing itself instead of A19:01
nottingsadmac2: correct,that's what happened AFAICT19:02
nottingsadmac2: erm19:02
nottingif you pass --no-wait, it stops itself. if you don't pass --no-wait, it hangs :)19:02
sadmac2ah19:04
sadmac2that makes sense. Its waiting for itself to stop, which can't happen because it can't progress beyond post-start until its done waiting19:05
sadmac2my first thought was that it was ignoring the argument and stopping $UPSTART_JOB instead of the target19:05
sadmac2but that all looks right.19:06
sadmac2come to think of it, running initctl stop with no arguments will cause some funny things won't it...19:06
sadmac2depending on where you do it.19:07
Keybukno.19:07
sadmac2Keybuk: whatever terminal you are running is most likely the descendant of some upstart task, so it probably has an UPSTART_JOB of god knows what (most likely the getty or X session, which is actually ok)19:08
Keybuk?19:10
KeybukUPSTART_JOB isn't used if the command has arguments19:10
sadmac2Keybuk: right. so if you happen to type "stop" in a terminal with no arguments, the results might be strange.19:10
Keybuksometimes19:11
Keybukin practice, most top-level things are good at sanitising their environment before running things like shells19:11
sadmac2good to know.19:11
KeybukPAM does it, for example19:11
Keybukso if you have a PAM session, you have the env cleaned up19:11
sadmac2polkit I'd assume the same?19:12
Keybukright19:14
smoserKeybuk, https://bugs.launchpad.net/ubuntu/+source/linux-ec2/+bug/510130 and https://bugs.launchpad.net/ubuntu/+source/linux-ec2/+bug/51013019:56
JanCsmoser: that's 2x the same (guess you wanted to point to 2 different bugs)20:09
smoseroops.20:09
smoserhttps://bugs.launchpad.net/ubuntu/+source/mountall/+bug/509841 was the other20:10
travisclinedoes anyone have an example nginx upstart file?21:29
travisclineanybody have an apache upstart example?21:38
travisclineit seems to me having more examples of typical servers would be a Good Thing21:41
sadmac2traviscline: upstart changes api a lot. The result is we don't encourage people to actually /use/ it per se :)21:42
travisclinei just upgraded from 0.3.9 and was using it for apache and varnish21:42
sadmac2traviscline: what distro?21:42
travisclinebut upped to 0.6.2 so i could use the expect fork / daemon stuff21:42
travisclineubuntu, 9.1021:42
travisclinewhen starting nginx (which daemonizes) with expect daemon the start just hangs21:43
travisclineeven though it starts it21:43
sadmac2traviscline: doesn't it come with startup scripts? are you building yourself?21:43
sadmac2traviscline: try expect fork instead.21:43
travisclinei did, trying again21:43
travisclinestart hangs21:44
travisclinewith expect fork21:44
travisclineand doesn't start it21:44
travisclinectl-c'd it -- it thinks the job is running now21:45
travisclinestopping hangs21:45
sadmac2traviscline: are you sure this job is running?21:45
sadmac2*forking21:45
travisclinectl-c'd - marked as not running21:46
travisclinewhen i just run 'nginx' it returns immediately21:46
travisclineand starts at least 2 processes21:46
travisclinerunning both start and stop with -v produce no additional output21:47
travisclinehere's strace output https://gist.github.com/586c7d3aff64c7e4642921:48
sadmac2traviscline: no clone call21:49
travisclinethat does mark the job as running though21:49
travisclinesadmac2: sorry, not familiar21:50
travisclineis that nginx's fault?21:50
sadmac2traviscline: the strace doesn't show anything forking. at all.21:50
travisclinesadmac2: https://gist.github.com/586c7d3aff64c7e46429 that's it when i don't run it with start21:51
travisclinethis is my job https://gist.github.com/084de4d8d90ab87d6cc921:51
sadmac2traviscline: there's no use stracing the start command.21:52
travisclineok21:52
travisclineany input on debugging paths?21:52
travisclineor should i punt because upstart isn't ready for real use?21:52
sadmac2traviscline: try strace -f21:53
travisclineoutput looks appoximately the same21:54
travisclineapproximately*21:54
sadmac2...that's not right...21:54
sadmac2that makes no sense in fact21:54
sadmac2it should tell you what both sides of the fork do21:54
travisclinesadmac2: with -f https://gist.github.com/586c7d3aff64c7e4642921:55
sadmac2traviscline: no start21:55
travisclineor did you want that on vanilla nginx (not start)21:55
travisclinegotcha21:55
sadmac2traviscline: stracing start makes no sense. It'll just tell us what the start command is doing. It tells us nothing about nginx21:56
travisclinesadmac2: i see, sorry. https://gist.github.com/586c7d3aff64c7e46429 there it is with -f21:56
sadmac2expect fork should do it.21:59
sadmac2something odd happens to the first fork though21:59
sadmac2Keybuk: any idea what's up with 6396 in that strace?22:00
travisclinemight be the same as this https://bugs.launchpad.net/upstart/+bug/40639722:06
travisclineanyhow, it looks like there isn't an easy fix and i'll just use supervised to keep services up22:06
travisclineor something like it22:06
Keybuksadmac2: probably getting stuck with fork following22:31
Keybukeither by SIGCHLD handler, or because the job does something weird22:31
Keybuklike fork/exec something else first22:31
sadmacKeybuk: figured that much. It is weird in that we end up with two daemon processes, but with expect fork I'd think we'd be done tracing before that stuff happened22:47
=== Keybuk changed the topic of #upstart to: Upstart 0.6.5 "Our last, best hope for victory" | http://upstart.ubuntu.com/

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