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
[email protected]
http://lists.nongnu.org/mailman/listinfo/monit-dev

Reply via email to