[09:26] I have a "two stage" process; first, I make a curl request to a URL which returns me a hostname, and then I ssh to that hostname with autossh. I'd like to have upstart manage this process so that if autossh dies it gets respawned, but I don't want it to run the curl again if it gets respawned; just restart autossh. How am I best to do that with upstart? [11:19] aquarius_: I'm not sure it's a good idea to build something like that. What if it drops because host moved? [11:19] How would you manage repetitive respawns in transition process? [11:20] If I were you, I'd write a wrapper app to manage respawn of autossh. [11:20] And set up that as the job. [11:46] AnrDaemon: I thought about that, but I don't think I can tell the difference between "it dropped because there was a network wobble" and "it dropped because the host is gone", but I want to reconnect on wobbles and do a new curl request if the host goes away [11:47] I do see your point though. [11:47] That's up to your wrapper to solve. Ping the host, if not available, lookup and ping again, for example. [11:48] on the actual upstart point, what I've done is have two jobs; one is start on network-up and does the curl, then emits start-the-ssh HOST=somehost, and the second is start on start-the-ssh; stop on network-down; respawn; exec autossh $HOST [11:48] can I tell from inside a job if I was respawned by upstart? [11:51] what I'm trying to avoid is writing my own tiny service monitor to deal with autossh dying, because upstart's good at that and I'm not :) [12:01] Second upstart question. Does upstart fire an event when one connects to or disconnects from a wireless access point? I can put a script in /etc/NetworkManager/dispatcher.d to do that and fire a custom event, of course, but it'd be nice to stay within upstart. === JanC is now known as Guest73215 === JanC_ is now known as JanC [14:57] aquarius_: If you want to go that route, you can just make second job an instance. [14:58] But you'll need to have first job start on stopped XXX. [15:00] AnrDaemon: can you explain that in a bit more detail? I don't think I really understand instances [15:00] Instance is a job that can be started multiple times, each identified by a key. [15:01] So, say, you make it "instance $HOST" and start one instance per host. http://upstart.ubuntu.com/cookbook/#instance [15:28] ah, I get it, I think. Cheers