codebeakehi all, is there a way to allow upstart jobs to be started multiple times? I have a daemon (Unicorn) which takes care of gracefully restarting, if you start it whilst it's already running, seems reasonable - but I can't find any relevant service stanza that would permit "multiple instances"10:09
plautrba_codebeake: try init(5) - part Instances 10:11
codebeakethanks plautrba_ :)10:11
codebeakehrm, "task" stanza looks promising, but I'm afraid then the `respawn` et al wouldn't work as expected10:14
codebeake(reading the section on instances below that, but the `task` was nice to find out about)10:15
codebeakeplautrba_: thanks for the suggestion, I don't want to pass variables, shame I can't shell out and see if the pid exists, already (and then start a differently identified instance)10:21
codebeakeIt's also not possible to specify how to restart the task, right? They always receive the same signal, regardless10:42
=== soren_ is now known as soren
SpamapScodebeake: wait, why do you want to start the job/task multiple times?16:23
SpamapScodebeake: re restarting, restart is always stop/start16:24
SpamapScodebeake: reload is always SIGHUP16:24
SpamapScodebeake: you can change the kill signal in newer versions of upstart with 'kill signal XXXXXX'16:24
codebeakeSpamapS, because Unicorn is a special case, where via it's configuration file you can add a block of code, which gracefully restarts16:35
codebeakewhen sending the process URS2, then it gratefully restarts16:36
SpamapScodebeake: right, thats why apache isn't upstartified either :)16:37
codebeakeI think my upstart version is too old, though - I'm on whatever ships with 10.10/10.4 Ubuntu16:37
codebeakeah, ok - so I might want to look at regular init scripts16:37
SpamapScodebeake: well for apache there's apachectl to do gracefuls, and then the upstart job would, in theory, just manage the boot/shutdown.16:37
SpamapScodebeake: but yeah, simpler to just use an init script if there's already one16:38
greylurkI'm writing an upstart script that is hanging when I try to call it.  How do I figure out where it's logging to?16:49
greylurkit just sits at start/killed forever.16:49
codebeakeI wonder SpamapS, if it's worth making a restart scropt, that just checks for the pidfile, and signals that pid16:54
codebeakeI can chmod+xs it to my web application user16:54
codebeakeand use it in my deployments, then16:54
JanCgreylurk: jobs != scripts, so you can't "call" them  ;)17:00
JanCand logging depends on the upstart version17:01
JanC(there is some info about logging in the cookbook)17:01
JanCcodebeake: you can specify how to start/stop a service by using pre/post-start/stop instead of plain exec/script stanzas17:04
codebeakeJanC, thanks17:11
codebeakethe long and short is - that I need to be able to call start, since I don't want to replicate this logic, but I'll see what I can find17:11
codebeakethis is the unicorn behaviour - https://gist.github.com/5471a06ab93f192178c217:11
codebeakeIf I can find a way to do that in upstart, then I'm sorted17:12
JanChttp://upstart.ubuntu.com/cookbook/ --> has lots of useful info and tips & tricks17:12
codebeakeI'm stuck with an old version, alas17:13
codebeakeand I *know* I'll screw something up, if I try and upgrade a running production system's init system :)17:13
codebeake0.6.5, right now17:13
codebeake(and when I USR2 it myself, upstart loses track of the pid… so, yeah - I think it might be time to find an alt. solution)17:32
codebeakethanks for the help and advice17:32
codebeakeis it wise to do a source install of upstart, with a recent version on ubuntu 10.4 ?17:42
codebeake… I notice there's not a new enough version of libnih in apt to satisfy the 1.0 (at least) ./configure script, and I remember last time I tried to do this, it involved a trip down the rabithole17:43
greylurkIs there any way to run "initctl start" with debugging info?  I have a script that's hanging at start/killed, but it works when I run the command from the command prompt.18:32
SpamapSgreylurk: initctl log-priority info22:04
SpamapSgreylurk: that will make init dump logs into syslog22:04
SpamapSgreylurk: you can make it spit even more info with 'initctl log-priority debug'22:04
greylurkThanks, it turned out that the init process was holding on to one specific pid, and wouldn't let it go even though the pid had died.  I ended up having to reboot but it's fine now.22:43
SpamapSgreylurk: thats a known bug when using 'expect fork' with a process that does not really fork22:43
SpamapSgreylurk: another workaround to rebooting is to write a program that forks a whole bunch of times until it hits the desired pid22:44
SpamapSI really wish we could add an 'initctl forget job_name'22:44

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