On Mon, May 13, 2013 at 3:38 PM, Guido Trotter <[email protected]> wrote:

>
> On 13 May 2013 15:09, "Michele Tartara" <[email protected]> wrote:
> >
> > Add the monitoring daemon to the command starting the node daemon, given
> that
> > they both have to be started on all nodes.
> >
> > Note that daemon-util only supports starting one daemon at the time, so
> the
> > actual command has to be composed as a sequence of two different
> daemon-util
> > invocations.
> >
> > Also, the monitoring daemon invocation is conditional, depending on
> whether it
> > was enabled at configure time.
> >
> > Signed-off-by: Michele Tartara <[email protected]>
> > ---
> >  lib/tools/node_daemon_setup.py |   11 ++++++++---
> >  1 file changed, 8 insertions(+), 3 deletions(-)
> >
> > diff --git a/lib/tools/node_daemon_setup.py
> b/lib/tools/node_daemon_setup.py
> > index 28bcba0..5991f47 100644
> > --- a/lib/tools/node_daemon_setup.py
> > +++ b/lib/tools/node_daemon_setup.py
> > @@ -216,12 +216,17 @@ def Main():
> >          not opts.dry_run):
> >        logging.info("Restarting node daemon ...")
> >
> > -      cmd = ("%s stop-all; %s start %s" %
> > -             (pathutils.DAEMON_UTIL, pathutils.DAEMON_UTIL,
> constants.NODED))
> > +      mond_cmd = ""
> > +      if constants.ENABLE_MOND:
> > +        mond_cmd = "; %s start %s" % (pathutils.DAEMON_UTIL,
> constants.MOND)
> > +
> > +      cmd = ("%s stop-all; %s start %s%s" %
> > +             (pathutils.DAEMON_UTIL, pathutils.DAEMON_UTIL,
> constants.NODED,
> > +              mond_cmd))
> >
>
> This is a bit ugly. Could you extract all commands out? (eg stop_cmd
> noded_cmq and mond_cmd) Or change daemon utils to be able to handle more
> than one daemon?
>

daemon-utils accepts parameters for the daemon, after the daemon name, so
changing it would change its syntax quite a lot.

Here I had gone for the modification with minimal impact, but I'll resend
the patch refactoring the code to make it more readable, instead.

Thanks,
Michele

Reply via email to