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 puppetmasters | 15:08 |
---|---|---|
SpamapS | glenn___: can you point me to the code that spawns multiple mongrel based puppet masters right now? | 17:02 |
SpamapS | glenn___: I suspect you'll want to use the 'instance' keyword | 17: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 work | 18:01 |
SpamapS | start on puppetmaster | 18:01 |
SpamapS | stop on puppetmaster | 18:01 |
SpamapS | glenn___: neither of those will do anything useful :) | 18:01 |
glenn___ | spamaps: when i start puppetmaster, it will start puppetmasters too :) | 18:02 |
SpamapS | glenn___: you probably want 'stop on stopping puppetmaster' | 18:02 |
glenn___ | spamaps: just tried that, and gave weird fails, ill try it again :> | 18:02 |
SpamapS | glenn___: yes, but there is no defined event 'puppetmaster' so that start on isn't useful | 18:02 |
glenn___ | spamaps: when im using stop op stopping puppetmaster it wont start anymore | 18:03 |
SpamapS | glenn___: why not do the check for mongrel in puppetmaster, so you avoid ever starting 'puppetmaster' ? | 18:03 |
SpamapS | err | 18:04 |
SpamapS | puppetmasters | 18:04 |
SpamapS | those names are very confusing | 18:04 |
SpamapS | would rather see a 'puppetmaster-mongrel' | 18:04 |
glenn___ | oh the logfile is starting it, the processes are just not spawned | 18:04 |
SpamapS | glenn___: all in all though, you're on the right track | 18: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 puppetmasters | 18:05 |
SpamapS | glenn___: right, seems silly to go through the trouble of starting another job.. when you could do that check in 'puppetmaster' | 18:05 |
SpamapS | and void the entire loop | 18:06 |
SpamapS | avoid rather | 18:06 |
SpamapS | oh wait | 18:06 |
SpamapS | you do | 18:06 |
SpamapS | so nevermind :) | 18:06 |
glenn___ | hehe | 18:06 |
glenn___ | but why would it not start if i say stop on stopping puppetmaster | 18:11 |
SpamapS | glenn___: it should stop at that point, yes. | 18:13 |
SpamapS | glenn___: 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 confused | 18:39 |
glenn___ | when i add that line, nothing is starting anymore :( | 18:39 |
glenn___ | and when i remove it, everything starts, but wont stop | 18:40 |
glenn___ | lol | 18:41 |
glenn___ | root@puppetclient:/etc/init# stop puppetmaster | 18:45 |
glenn___ | stop: Unknown instance: | 18:45 |
glenn___ | carnit | 18:45 |
glenn___ | i think i know why its stopping | 18: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___ | ls | 19:02 |
glenn___ | im on it :> | 19:03 |
glenn___ | almost | 19:03 |
glenn___ | the pain :) | 19:03 |
SpamapS | glenn___: its stopped because your script exitted | 19:06 |
SpamapS | glenn___: 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___ | argh | 19: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 daemon | 20:00 |
glenn___ | at least it stops too :> | 20:01 |
glenn___ | ps auxf | 20: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 good | 20:22 |
SpamapS | glenn___: there seems to be a lot of "extra" stuff there... I think it could be done simpler. :-P | 20:58 |
jaha | how do i control an upstart job without sudo | 21:51 |
jaha | EX: start foojob, stop foojob | 21:51 |
jaha | i added the setuid and setgid but no go | 21:51 |
SpamapS | jaha: er, you don't? ;) those are root's commands. | 21:58 |
SpamapS | jaha: unless you're talking about user jobs. | 21:59 |
SpamapS | in ~/.init | 21:59 |
jaha | these are jobs i created | 21:59 |
jaha | conf files in /etc/init | 21:59 |
SpamapS | oh then those are system jobs | 21:59 |
SpamapS | and you must be root to manipulate them | 21:59 |
jaha | ok, well im trying to start/stop jobs through a chid process im spawning with node.js | 22:00 |
jaha | i get sudo errors when trying to sudo a command in the process, any idea how I might get around that? | 22:01 |
SpamapS | jaha: make sure you have NOPASSWD privileges for the start/stop commands | 22:02 |
SpamapS | so like this | 22:03 |
SpamapS | mydaemonuser ALL = NOPASSWD: start | 22:03 |
jaha | i also just found that "service job reload" may work, would that be safer? | 22:06 |
jaha | instead of sudo reload job | 22:06 |
SpamapS | jaha: no, its identical | 22:10 |
SpamapS | though I do advocate using the 'service' command because its more portable | 22:10 |
SpamapS | and restart "does the right thing" when the service is stopped | 22:10 |
SpamapS | (meaning it ignores that it is stopped, and starts it) | 22:10 |
jaha | thanks, i appreciate the help | 22:11 |
JanC | so basically: use sudo, but without password restrictions | 22:14 |
JanC | and 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 |
SpamapS | JanC: agreed | 22:28 |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!