/srv/irclogs.ubuntu.com/2011/12/14/#upstart.txt

joerni may be stupid or blind, but somehow i cannot find documentation about when exactly "emits" is processed01:17
joernis it before the exec, directly after the exec, a second later,...?01:18
broder"emits" is just metadata - it doesn't cause an event to get emitted01:18
broder(it's intended to annotate, e.g., "the executable i'm about to call is going to emit these events at some point")01:18
broderit's used by things like initctl show-config and initctl check-config for verification01:19
joernso the executable has to do whatever initialization and then somehow emit this event01:19
broderbut if you want to emit some event, you should use initctl emit in the exec/script line01:19
joernok01:19
joernand for "started foo", when is that event generated?01:20
broderthat's emitted when the job changes states from "starting" to started01:20
broderwhen that happens depends on the expect line and whether it's marked as a task or not01:20
broderpossibly other things, too01:20
joernso with "expect fork", as soon as fork(2) returns, i take it?01:21
broderor possibly when fork is called. i don't recall01:22
joerni would imagine there could be nasty race conditions then - although very hard to hit01:23
joernanyway, thanks!  i believe i have enough rope to hang myself now01:24
broderwell, you just have to make sure your daemon is actually ready whenever you trigger that transition01:24
broderso do all your setup (binding to ports, setting signal handlers) before you fork01:24
joernand maybe spend a night reading all existing /etc/init/*.conf files before writing my own01:25
broderif you're writing a daemon/binary targeted at upstart specifically, i'm a fan of "expect stop"01:26
broderthen you just do "raise(SIGSTOP);" whenever you're done with setup01:26
joerni would actually like not to have any dependencies on upstart.  we currently have tons of subtle dependencies and my unwritten job description is to find them all and remove them - or at least make them explicit01:28
joernwould be nice if i was the last person to suffer this pain01:28
broderyou should check out the upstart cookbook, btw, if you haven't01:29
joern4.3.1 seems to be the answer to most of my questions.  thanks!01:50
lamal666Hi, im trying to write an upstart job to execute a script but when i run it- nothing happens18:07
=== lamal666 is now known as lamalex
lamalexhttp://paste.ubuntu.com/770327/18:09
lamalexha clearly i cp'd another conf file..18:10
lamalexsudo start coverity 18:10
lamalexcoverity start/running, process 251818:10
lamalexis what i get18:10
lamalexbut the server doesn't really start18:11
ionhttp://upstart.ubuntu.com/cookbook/#obtaining-a-log-of-a-script-section18:13
lamalexion, so i dont have a script stanza- i just have exec18:15
lamalexcan i just put this above the exec line18:15
lamalexor do i need script stanza18:15
xakahi! is anyone from dev team here?18:18
ionlamalex: Change18:22
ionexec foo18:22
ionto18:22
ionscript18:22
ion  exec >/path/to/log 2>&118:22
ion  set -x18:22
ion  exec foo18:22
ionend script18:22
lamalexion, also is it possible to write a custom stop job?18:28
ionUse pre-stop.18:28
lamalexah cool thanks18:30
xakais there any way to specify dependencies? like i want to start service A on runlevel 2345, but after service B has been started18:33
ionA: start on started B, stop on stopping B18:35
ionB: start on runlevel [2345], stop on runlevel [!2345]18:35

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