/srv/irclogs.ubuntu.com/2011/11/29/#upstart.txt

johnmHello all. I wonder if anyone can answer what I presume to be a quick question. I have an upstart job with named instances, and I wanted to specify which named isntances to automatically start during init. Is this possible?10:02
jhuntjohnm: you mean at boot? If so, you'll need to arrange for some other job or event to specify which named instances of the job to start.10:11
jhuntjohnm: have you read http://upstart.ubuntu.com/cookbook/#instance ?10:11
johnmjhunt: I have indeed, but it didn't really imply how best to do it regarding multiple instances on boot.10:17
johnmI already have a working script, I just presumed there may be a neater way than having a new job in place to call the other with arguments, which is what I presume needs to happen?10:18
johnm(as mentioned in the doc)10:18
jhunt'instance' is a way to allow a single job to run multiple times. However, you need something to *tell* that job to run multiple times with a given unique name :)10:19
johnmabsolutely. I hoped there was something a little fancier in upstart to already cater for it opposed to having another job call it - but it's no biggy :)10:19
johnmThanks.10:20
jhunthow would that work though? remember that Upstart needs to track a single pid, hence a job needs to map to a single pid, hence you cannot have a job creating multiple pids. 10:20
jhuntbut you can have multiple jobs with a single pid each and that's what instance provides.10:21
johnmI've only recently been digging into upstart in any serious fashion, but I suppose what I was expecting was an interface somewhat similar to how initctl list would display instanced jobs when it came down to executing jobs. perhaps a small stanza somewhat similar to the start stanza defining which enumerations of the script. But without understanding upstart internals more that might be a very naive way of looking at it.10:23
johnmperhaps even something a little like 'start on runlevel [2345] instances ( "INSTANCE=instance1 VAR1=one VAR2=two" "INSTANCE=instance2 VAR1=one VAR2=two" )' etc10:26
jhuntjob configuration files are supposed to be simple and that's already looking pretty hairy :) Also, you're hard-coding the instance within the job itself. What if you want to create a new instance dynamically to cater for an increase in demand for your service?10:29
johnmisn't that the idea of it being instanced anyway? but yes, I imagined the enumeration to happen within upstart outside of the job configuration itself10:30
johnmbut I realise that upstart doesnt seem to habe much external configuration if any outside of the jobs themselves anyway10:31
johnmI mean, having the second job to start instanced jobs is much the same as just sticking the initial instances hardcoded in the job itself.10:34
johnmit just makes it a single .conf opposed to two.10:35
jhuntnot quite - *any number* of other jobs could be configured to start new instances of your service should you so desire. And crucially, an admin could also manually start more instances using initctl. It's an interesting idea, but I don't envisage that we'll be changing the design any time soon as the current one works very well :)10:43
johnmYeah indeed, it was more me just not understanding that a new job to orchestrate the instanced job itself was required :)10:57
johnmI thought it may be possible to essentially instruct upstart that when executing jobX to enumerate it passing in ARGs for each instance specified. Perhaps though something similar to update-rc.d, but I think that I missed the point there :)10:58
johnmI suppose I'm using a slightly awkward example of mongod10:59
johnmthere is also the problem of course whereby start-stop-daemon will check the path to binary on --exec and for multuple instance jobs where it's expected to run multiple, it just exits successful.11:00
johnmI saw the bug talking about making that native in the future, which would be nice (since the exec su shell hack is pretty messy), but for cases where the instances are fairly static then it's a bit odd.11:00
johnmanother example might be multiple instances of MySQL or similar.11:01
johnmhttpd has been used in the cookbook example somewhere I think.11:01
johnmAll of these things would require static configuration unless the job itself were to instance based on globbing config files or some such11:01
johnm(which to be honest, is probably the more sensible way)11:02
johnmjust controlling it might then prove a little tricky ;)11:02
scoopexmy apache webserver uses configuration snippes which are located at a nfs share....on systemboot it fails to start because the nfs share is mounted to late(snippet cannto be loaded).....the lsb-tags of apache request $remote_fs...but ubuntu seems to ignore this...any hints?19:19
=== zyga-ill is now known as zyga
=== zyga-ill is now known as zyga

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