/[monit]/monit/monitor.c
ViewVC logotype

Diff of /monit/monitor.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.52 by hauk, Sun Jun 22 20:31:16 2003 UTC revision 1.53 by hauk, Thu Jun 26 14:24:11 2003 UTC
# Line 189  static void do_init() { Line 189  static void do_init() {
189     */     */
190    if(Run.testing) {    if(Run.testing) {
191    
192      error("Control file syntax OK\n");      log("Control file syntax OK\n");
193      exit(0);      exit(0);
194    
195    }    }
# Line 364  static void do_action(char **args) { Line 364  static void do_action(char **args) {
364            
365    } else if(IS(action, "reload")) {    } else if(IS(action, "reload")) {
366            
367      error("Reinitializing monit daemon\n", prog);      log("Reinitializing monit daemon\n", prog);
368      kill_daemon(SIGHUP);      kill_daemon(SIGHUP);
369            
370    } else if(IS(action, "restart")) {    } else if(IS(action, "restart")) {
# Line 373  static void do_action(char **args) { Line 373  static void do_action(char **args) {
373        if(! IS(P, "all")) {        if(! IS(P, "all")) {
374          if(! exist_service(P)) {          if(! exist_service(P)) {
375                        
376            error("%s: Cannot restart program '%s' -- not found in %s\n",            log("%s: Cannot restart program '%s' -- not found in %s\n",
377                  prog, P, Run.controlfile);                  prog, P, Run.controlfile);
378                        
379            return;            return;
# Line 407  static void do_action(char **args) { Line 407  static void do_action(char **args) {
407            
408    } else if(IS(action, "quit")) {    } else if(IS(action, "quit")) {
409            
410      error("Stopping monit daemon\n", prog);      log("Stopping monit daemon\n", prog);
411      kill_daemon(SIGTERM);      kill_daemon(SIGTERM);
412            
413    } else if(IS(action, "validate")) {    } else if(IS(action, "validate")) {
# Line 417  static void do_action(char **args) { Line 417  static void do_action(char **args) {
417    } else {    } else {
418    
419      error:      error:
420      error("%s: invalid argument -- %s  (-h will show valid arguments)\n",      log("%s: invalid argument -- %s  (-h will show valid arguments)\n",
421            prog, action);            prog, action);
422      exit(1);      exit(1);
423            
# Line 463  static int do_wakeupcall() { Line 463  static int do_wakeupcall() {
463    if((pid= exist_daemon()) > 0) {    if((pid= exist_daemon()) > 0) {
464            
465      kill(pid, SIGUSR1);      kill(pid, SIGUSR1);
466      error("%s daemon at %d awakened\n", prog, pid);      log("%s daemon at %d awakened\n", prog, pid);
467            
468      return TRUE;      return TRUE;
469            
# Line 601  static void handle_options(int argc, cha Line 601  static void handle_options(int argc, cha
601          Run.isdaemon= TRUE;          Run.isdaemon= TRUE;
602          sscanf(optarg, "%d", &Run.polltime);          sscanf(optarg, "%d", &Run.polltime);
603          if(Run.polltime<1) {          if(Run.polltime<1) {
604            error("%s: option -%c requires a natural number\n", prog, opt);            log("%s: option -%c requires a natural number\n", prog, opt);
605            exit(1);            exit(1);
606          }          }
607          break;          break;
# Line 659  static void handle_options(int argc, cha Line 659  static void handle_options(int argc, cha
659          case 'g':          case 'g':
660          case 'l':          case 'l':
661          case 'p':          case 'p':
662              error("%s: option -- %c requires an argument\n", prog, optopt);              log("%s: option -- %c requires an argument\n", prog, optopt);
663              break;              break;
664          default:          default:
665              error("%s: invalid option -- %c  (-h will show valid options)\n",              log("%s: invalid option -- %c  (-h will show valid options)\n",
666                    prog, optopt);                    prog, optopt);
667                            
668          }          }

Legend:
Removed from v.1.52  
changed lines
  Added in v.1.53

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26