/srv/irclogs.ubuntu.com/2012/03/19/#upstart.txt

glenn___spamaps: ok well that is good news and bad news, since 12.04 would still support mongrel.. thus the upstart script should spawn multiple puppetmasters15:08
SpamapSglenn___: can you point me to the code that spawns multiple mongrel based puppet masters right now?17:02
SpamapSglenn___: I suspect you'll want to use the 'instance' keyword17:02
glenn___spamaps: http://paste.ubuntu.com/890983/ and http://paste.ubuntu.com/890984/17:58
glenn___spamaps: its what i have so far... and it spawnz multiple masters.. it just wont shut them down yet :)17:58
glenn___spamaps: I must be doing something wrong.. but im glad its spawning multiple masters though.. just finished that work18:01
SpamapSstart on puppetmaster18:01
SpamapSstop on puppetmaster18:01
SpamapSglenn___: neither of those will do anything useful :)18:01
glenn___spamaps: when i start puppetmaster, it will start puppetmasters too :)18:02
SpamapSglenn___: you probably want 'stop on stopping puppetmaster'18:02
glenn___spamaps: just tried that, and gave weird fails, ill try it again :>18:02
SpamapSglenn___: yes, but there is no defined event 'puppetmaster' so that start on isn't useful18:02
glenn___spamaps: when im using stop op stopping puppetmaster it wont start anymore18:03
SpamapSglenn___: why not do the check for mongrel in puppetmaster, so you avoid ever starting 'puppetmaster' ?18:03
SpamapSerr18:04
SpamapSpuppetmasters18:04
SpamapSthose names are very confusing18:04
SpamapSwould rather see a 'puppetmaster-mongrel'18:04
glenn___oh the logfile is starting it, the processes are just not spawned18:04
SpamapSglenn___: all in all though, you're on the right track18:05
glenn___spamaps: thanks :) but in puppetmasters (mongrel) im doing a check for servertype = mongrel 18:05
glenn___spamaps: so if its not mongrel it wont use puppetmasters18:05
SpamapSglenn___: right, seems silly to go through the trouble of starting another job.. when you could do that check in 'puppetmaster'18:05
SpamapSand void the entire loop18:06
SpamapSavoid rather18:06
SpamapSoh wait18:06
SpamapSyou do18:06
SpamapSso nevermind :)18:06
glenn___hehe18:06
glenn___but why would it not start if i say stop on stopping puppetmaster18:11
SpamapSglenn___: it should stop at that point, yes.18:13
SpamapSglenn___: which means it wil be sent SIGTERM, then if it hasn't died in 5 seconds, it will be sent 'SIGKILL' (you can change that with 'kill timeout #')18:14
glenn___im confused18:39
glenn___when i add that line, nothing is starting anymore :(18:39
glenn___and when i remove it, everything starts, but wont stop18:40
glenn___lol18:41
glenn___root@puppetclient:/etc/init# stop puppetmaster18:45
glenn___stop: Unknown instance: 18:45
glenn___carnit18:45
glenn___i think i know why its stopping18:59
glenn___its only starting the puppetmastermongrels, it leaves puppetmaster stopped :)18:59
glenn___how am i supposed to keep puppetmaster running when it only spawns puppetmastermongrels?19:01
glenn___ls19:02
glenn___im on it :>19:03
glenn___almost19:03
glenn___the pain :)19:03
SpamapSglenn___: its stopped because your script exitted19:06
SpamapSglenn___: so instead of 'stop on stopping puppetmaster' I'd recommend 'stop on runlevel [^2345]'19:07
glenn___spamaps: i fixed that, im using ur tip now..19:08
glenn___argh19:37
glenn___spamaps: how can i have puppetmaster running, when it is starting other upstart jobs? 19:38
glenn___spamaps: isnt there a trick so puppetmaster will show the other upstart jobs, and think its running?19:38
glenn___oh 19:58
glenn___i think i got something now :>19:58
glenn___but this will only start 1 extra daemon20:00
glenn___at least it stops too :>20:01
glenn___ps auxf20:01
glenn___IT WORX :>20:09
glenn___i just need 3 upstart files :)20:10
glenn___Spamaps: http://paste.ubuntu.com/891213/ http://paste.ubuntu.com/891214/ http://paste.ubuntu.com/891217/20:12
glenn___awesome :)20:13
glenn___im someone could review this and give me feedback that would be good20:22
SpamapSglenn___: there seems to be a lot of "extra" stuff there... I think it could be done simpler. :-P20:58
jahahow do i control an upstart job without sudo21:51
jahaEX: start foojob, stop foojob21:51
jahai added the setuid and setgid but no go21:51
SpamapSjaha: er, you don't? ;) those are root's commands.21:58
SpamapSjaha: unless you're talking about user jobs.21:59
SpamapSin ~/.init21:59
jahathese are jobs i created21:59
jahaconf files in /etc/init21:59
SpamapSoh then those are system jobs21:59
SpamapSand you must be root to manipulate them21:59
jahaok, well im trying to start/stop jobs through a chid process im spawning with node.js22:00
jahai get sudo errors when trying to sudo a command in the process, any idea how I might get around that?22:01
SpamapSjaha: make sure you have NOPASSWD privileges for the start/stop commands22:02
SpamapSso like this22:03
SpamapSmydaemonuser ALL = NOPASSWD: start22:03
jahai also just found that "service job reload" may work, would that be safer?22:06
jahainstead of sudo reload job22:06
SpamapSjaha: no, its identical22:10
SpamapSthough I do advocate using the 'service' command because its more portable22:10
SpamapSand restart "does the right thing" when the service is stopped22:10
SpamapS(meaning it ignores that it is stopped, and starts it)22:10
jahathanks, i appreciate the help22:11
JanCso basically: use sudo, but without password restrictions22:14
JanCand you might want to restrict what services can be manipulated without password...22:14
JanC(I don't think it's a good idea 'mydaemonuser' can start/stop random jobs)22:16
SpamapSJanC: agreed22:28

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