[10:09] <codebeake> hi 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:11] <plautrba_> codebeake: try init(5) - part Instances 
[10:11] <codebeake> thanks plautrba_ :)
[10:14] <codebeake> hrm, "task" stanza looks promising, but I'm afraid then the `respawn` et al wouldn't work as expected
[10:15] <codebeake> (reading the section on instances below that, but the `task` was nice to find out about)
[10:21] <codebeake> plautrba_: 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:42] <codebeake> It's also not possible to specify how to restart the task, right? They always receive the same signal, regardless
[16:23] <SpamapS> codebeake: wait, why do you want to start the job/task multiple times?
[16:24] <SpamapS> codebeake: re restarting, restart is always stop/start
[16:24] <SpamapS> codebeake: reload is always SIGHUP
[16:24] <SpamapS> codebeake: you can change the kill signal in newer versions of upstart with 'kill signal XXXXXX'
[16:35] <codebeake> SpamapS, because Unicorn is a special case, where via it's configuration file you can add a block of code, which gracefully restarts
[16:36] <codebeake> when sending the process URS2, then it gratefully restarts
[16:37] <SpamapS> codebeake: right, thats why apache isn't upstartified either :)
[16:37] <codebeake> I think my upstart version is too old, though - I'm on whatever ships with 10.10/10.4 Ubuntu
[16:37] <codebeake> ah, ok - so I might want to look at regular init scripts
[16:37] <SpamapS> codebeake: well for apache there's apachectl to do gracefuls, and then the upstart job would, in theory, just manage the boot/shutdown.
[16:38] <SpamapS> codebeake: but yeah, simpler to just use an init script if there's already one
[16:49] <greylurk> I'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] <greylurk> it just sits at start/killed forever.
[16:54] <codebeake> I wonder SpamapS, if it's worth making a restart scropt, that just checks for the pidfile, and signals that pid
[16:54] <codebeake> I can chmod+xs it to my web application user
[16:54] <codebeake> and use it in my deployments, then
[17:00] <JanC> greylurk: jobs != scripts, so you can't "call" them  ;)
[17:01] <JanC> and logging depends on the upstart version
[17:01] <JanC> (there is some info about logging in the cookbook)
[17:04] <JanC> codebeake: you can specify how to start/stop a service by using pre/post-start/stop instead of plain exec/script stanzas
[17:11] <codebeake> JanC, thanks
[17:11] <codebeake> the 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 find
[17:11] <codebeake> this is the unicorn behaviour - https://gist.github.com/5471a06ab93f192178c2
[17:12] <codebeake> If I can find a way to do that in upstart, then I'm sorted
[17:12] <JanC> http://upstart.ubuntu.com/cookbook/ --> has lots of useful info and tips & tricks
[17:13] <codebeake> I'm stuck with an old version, alas
[17:13] <codebeake> and I *know* I'll screw something up, if I try and upgrade a running production system's init system :)
[17:13] <codebeake> 0.6.5, right now
[17:32] <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] <codebeake> thanks for the help and advice
[17:42] <codebeake> is it wise to do a source install of upstart, with a recent version on ubuntu 10.4 ?
[17:43] <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 rabithole
[18:32] <greylurk> Is 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.
[22:04] <SpamapS> greylurk: initctl log-priority info
[22:04] <SpamapS> greylurk: that will make init dump logs into syslog
[22:04] <SpamapS> greylurk: you can make it spit even more info with 'initctl log-priority debug'
[22:43] <greylurk> Thanks, 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] <SpamapS> greylurk: thats a known bug when using 'expect fork' with a process that does not really fork
[22:44] <SpamapS> greylurk: another workaround to rebooting is to write a program that forks a whole bunch of times until it hits the desired pid
[22:44] <SpamapS> I really wish we could add an 'initctl forget job_name'