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