[07:40] hi :) to write an upstart script with instances, I want for each instance to read a resource file, and then for all of them, to execute a script [07:41] is there a way to "close" an instance? like instance $conf [....] fi ? [07:48] Yann2: you have to stop them, or have them stop themselves: http://upstart.ubuntu.com/cookbook/#attempting-to-stop-a-job-that-requires-an-instance-variable [07:48] jodh, that's not what I meant - I mean, the configuration part for an instance starts after instance $VAR , but ends when? [07:51] Yann2: I think you're misunderstanding what instances are - they are normal jobs but include the stanza 'instance' followed by some variable name (or names). So, a running instance of a job configuration file with a particular value of the instance variable(s) is your instance. [07:51] yes, that's what I need :) [07:52] let me reformulate (sry, english isn't my main language) [07:52] I want to write a script that starts a daemon of which there could be many instances, hence the "instance" [07:52] so I want to read a configuration file, to set all environment variables (they will be different for every instance) - defining, let's say, the port of the daemon [07:53] then I would start the daemon with daemon -p $PORT [07:53] so this is what I would want to do: [07:53] instance $CONF [07:54] . /etc/default/${CONF} [07:54] and then if I want to add additional lines, after the instance, where does the instance section end? [07:57] Yann2: I don't understand what you mean "add additional lines, after the instance" - the entire .conf file *is* your instance script. [07:57] so, you could have a .conf file that did: [07:57] instance $FOO [07:57] script [07:58] . /etc/default/$FOO [07:58] echo hello from instance $FOO [07:58] end script [07:58] Then, start 2 instances: [07:58] sudo start job FOO="abc" [07:58] sudo start job FOO=1 [07:58] mmmhhhh ok I think I'm getting it :) [07:59] Yann2: I suggest reading http://upstart.ubuntu.com/cookbook/#instance [08:00] in summary, the only "special" syntax for instance jobs is that they have the 'instance' stanza, and the rest of the job (the 'exec' and 'script' and 'pre-start script', etc) have access to the instance variable. [08:01] ok [08:27] Yann2: I've updated the Upstart Cookbook with a simple instance example which I think covers what we have just discussed: http://upstart.ubuntu.com/cookbook/#a-simple-instance-example [08:31] did you save? I see no difference so far [08:32] and the anchor doesn't work [08:32] but I think I got it, it was just me being dump :) [08:32] dumb [13:37] arrgh…upstart is giving me hedeaches... [13:37] I'm trying to restart a service….and it's just hanging there indefinitely [13:38] anyone idea ? [13:43] this is my job definition [13:43] https://gist.github.com/3858894 [13:48] gyre008: what is hanging? [13:48] start [13:48] initctl start nginx [13:48] hangs indefinitely [13:49] gyre008: that means your expect fork is likely wrong [13:49] m [13:49] m [13:50] its messy [13:53] gyre008: any reason you're not just using the init script for nginx? [13:53] well people are singing how awesome upstart is... [13:53] looks its probably not ;0 [13:54] this is killing me wtf initctl: Job is already running: nginx [13:54] NO ITS NOT [13:54] gyre008: its awesome.. for what its meant to be awesome for [13:55] gyre008: but there's no point in using it when there is already a perfectly good sysvinit script [23:53] i'm having a problem getting a service recognized [23:53] i added a file to /etc/init/ .. bulkagent.conf [23:54] but status bulkagent doesn't do anything. i have another one i wrote that i set up the same way.. just dropped it into /etc/init.. and that one works [23:54] what factors can cause a service to be omitted from the list? [23:55] the syntax of the two files is nearly identical. permissions are the same.