monit-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: -l cmd line arg broken


From: Martin Pala
Subject: Re: -l cmd line arg broken
Date: Fri, 1 Dec 2006 23:08:11 +0100

Thanks for report, fixed in cvs :)

Martin

On Dec 1, 2006, at 9:52 PM, Aaron Scamehorn wrote:

Hello,

It looks like it is impossible to get any output to go to a log file specified via the cmd line argsā€¦

From main, handle_options properly handles the cmd line arg, and sets Run.dolog, but do_init calls parse, which calls preparse, which sets Run.dolog=FALSE.

I don't think this last step is necessary.

Thanks,
Aaron



int main(int argc, char **argv) {

  prog= Util_basename(argv[0]);
  init_env();
  handle_options(argc, argv);

  do_init();
  do_action(argv);
  do_exit();

  return 0;

}

static void handle_options(int argc, char **argv) {
    .
    .
    .
    case 'l':
        Run.logfile= xstrdup(optarg);
         if(IS(Run.logfile, "syslog"))
             Run.use_syslog= TRUE;
         Run.dolog= TRUE;
        break;
    .
    .
    .
}

static void do_init() {
    .
    .
    .
    if(! parse(Run.controlfile)) {
        exit(1);
    }
    .
    .
    .
}

int parse(char *controlfile) {
    .
    .
    .
    preparse();
    .
    .
    .
}

static void preparse() {
    .  .  .
    Run.dolog= FALSE
    .  .  .
}


_______________________________________________
monit-dev mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/monit-dev





reply via email to

[Prev in Thread] Current Thread [Next in Thread]