/srv/irclogs.ubuntu.com/2014/07/14/#upstart.txt

ssarahhei guys14:52
ssarahi want to ask, i wana use upstart instead of node forever. How can i make it that upstart only tries to restart a process a number of times before calling for support?14:53
ssarahanyone? =O14:58
slangasekssarah: what do you mean by "calling for support"?17:06
slangasekyou can use the "respawn limit" command to control how many times upstart will retry a failing process; but I'm not sure if that's what you're asking for17:07
ssarahslangasek: i mean, that after failing for several times, it does a custom command18:01
ssarahget it? :)18:02
slangasekok18:02
slangasekupstart is certainly flexible enough that this should be possible, but I can't point to a ready-made example of someone doing this before18:02
slangasekin fact I think you probably would need to keep a counter, outside of upstart itself, unless the failures are immediate and could be done through 'respawn limit'18:03
xnoxssarah: i'd recommend use existing monitoring to monitor that service is up, when upstart gives up restarting it the status will change to "stop/waiting" and your monitoring system (nagios, check-mk, etc) can take appropriate action for automated recovery and/or further escalation.18:12
xnoxssarah: at least, in my previous sys-admin days that's what we did. Since nagios already does smart escalation notification and has appropriate means to encode shifts and rotas.18:12
ssarahxnox: what status changes to "stop/waiting"18:13
ssarah?18:13
xnoxssarah: of your job. If you start it, it becomes "$ status your-job" will say start/running. And would stay like that, and respawned as needed.18:17
xnoxssarah: when it fails permamently, it will change status to "$ status your-job" will become "stop/waiting", and thus your nagios monitoring can be checking that.18:18
ssarahim sorry if this sounds too basic but that variable is something i can see where?18:19
xnoxssarah: type on the command line: $ sudo status tty218:30
xnoxssarah: $ sudo stop tty218:30
xnoxssarah: $ sudo status tty218:30
xnoxssarah: $ sudo start tty218:30
xnoxssarah: $ sudo status tty218:30
xnoxssarah: $ cat /etc/init/tty2.conf18:30
xnoxssarah: for more about jobs, their states, what states they transition through and how to control/inspect/observe that see http://upstart.ubuntu.com/cookbook/18:31
xnoxssarah: for more control you can add your custom jobs, or e.g. monitor signals, events and notifications on the DBUS interface18:31

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