[sheepdog] Exit status of node recovery
Hitoshi Mitake
mitake.hitoshi at gmail.com
Tue Aug 27 06:49:02 CEST 2013
At Mon, 26 Aug 2013 13:24:08 +0800,
Liu Yuan wrote:
>
> On Fri, Aug 23, 2013 at 05:53:02PM +0200, Valerio Pachera wrote:
> > Hi, I'm wondering if it could be good to have an exit status different
> > from 0 when there's a recovery running.
> >
> > I wish to monitor if cluster is doing a recovery in nagios/icinga or
> > another application.
> >
> > To get this info I have to "parse" the output of 'node recovery'
> > instead of the exit status.
> >
> > lines=$(dog vdi recovery | wc -l)
> > if [ lines -ne 2 ]; then
> > echo "recovery is running"
> > fi
> >
> > Instead of
> >
> > dog vdi recovery > /dev/null
> > if [ $? -eq 1 ]; then
> > echo "recovery is running"
> > fi
> >
> > What do you think?
>
> I don't think first form is better than the second form. We use non-zero status
> code to indicate error of executing request as a general rule.
IIUC, non-zero values which indicate error are only EXIT_FAILURE (1)
and EXIT_SYSFAIL (2). Other code in include/exits.h is not for simple
errors. Using a new value for indicating recovery process can be
accepted.
Thanks,
Hitoshi
More information about the sheepdog
mailing list