Yann2 | 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:40 |
---|---|---|
Yann2 | is there a way to "close" an instance? like instance $conf [....] fi ? | 07:41 |
jodh | 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 |
Yann2 | jodh, that's not what I meant - I mean, the configuration part for an instance starts after instance $VAR , but ends when? | 07:48 |
jodh | 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 |
Yann2 | yes, that's what I need :) | 07:51 |
Yann2 | let me reformulate (sry, english isn't my main language) | 07:52 |
Yann2 | I want to write a script that starts a daemon of which there could be many instances, hence the "instance" | 07:52 |
Yann2 | 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:52 |
Yann2 | then I would start the daemon with daemon -p $PORT | 07:53 |
Yann2 | so this is what I would want to do: | 07:53 |
Yann2 | instance $CONF | 07:53 |
Yann2 | . /etc/default/${CONF} | 07:54 |
Yann2 | and then if I want to add additional lines, after the instance, where does the instance section end? | 07:54 |
jodh | Yann2: I don't understand what you mean "add additional lines, after the instance" - the entire .conf file *is* your instance script. | 07:57 |
jodh | so, you could have a .conf file that did: | 07:57 |
jodh | instance $FOO | 07:57 |
jodh | script | 07:57 |
jodh | . /etc/default/$FOO | 07:58 |
jodh | echo hello from instance $FOO | 07:58 |
jodh | end script | 07:58 |
jodh | Then, start 2 instances: | 07:58 |
jodh | sudo start job FOO="abc" | 07:58 |
jodh | sudo start job FOO=1 | 07:58 |
Yann2 | mmmhhhh ok I think I'm getting it :) | 07:58 |
jodh | Yann2: I suggest reading http://upstart.ubuntu.com/cookbook/#instance | 07:59 |
jodh | 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:00 |
Yann2 | ok | 08:01 |
jodh | 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:27 |
Yann2 | did you save? I see no difference so far | 08:31 |
Yann2 | and the anchor doesn't work | 08:32 |
Yann2 | but I think I got it, it was just me being dump :) | 08:32 |
Yann2 | dumb | 08:32 |
gyre008 | arrgh…upstart is giving me hedeaches... | 13:37 |
gyre008 | I'm trying to restart a service….and it's just hanging there indefinitely | 13:37 |
gyre008 | anyone idea ? | 13:38 |
gyre008 | this is my job definition | 13:43 |
gyre008 | https://gist.github.com/3858894 | 13:43 |
SpamapS | gyre008: what is hanging? | 13:48 |
gyre008 | start | 13:48 |
gyre008 | initctl start nginx | 13:48 |
gyre008 | hangs indefinitely | 13:48 |
SpamapS | gyre008: that means your expect fork is likely wrong | 13:49 |
gyre008 | m | 13:49 |
gyre008 | m | 13:49 |
gyre008 | its messy | 13:50 |
SpamapS | gyre008: any reason you're not just using the init script for nginx? | 13:53 |
gyre008 | well people are singing how awesome upstart is... | 13:53 |
gyre008 | looks its probably not ;0 | 13:53 |
gyre008 | this is killing me wtf initctl: Job is already running: nginx | 13:54 |
gyre008 | NO ITS NOT | 13:54 |
SpamapS | gyre008: its awesome.. for what its meant to be awesome for | 13:54 |
SpamapS | gyre008: but there's no point in using it when there is already a perfectly good sysvinit script | 13:55 |
MFen | i'm having a problem getting a service recognized | 23:53 |
MFen | i added a file to /etc/init/ .. bulkagent.conf | 23:53 |
MFen | 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 |
MFen | what factors can cause a service to be omitted from the list? | 23:54 |
MFen | the syntax of the two files is nearly identical. permissions are the same. | 23:55 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!