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

Diff of /monit/monitor.c

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

revision 1.38 by hauk, Sat Dec 21 01:43:36 2002 UTC revision 1.39 by hauk, Sat Dec 21 11:19:13 2002 UTC
# Line 58  Line 58 
58   *    monit [options] {arguments}   *    monit [options] {arguments}
59   *   *
60   *  @author Jan-Henrik Haukeland, <hauk@tildeslash.com>   *  @author Jan-Henrik Haukeland, <hauk@tildeslash.com>
61     *  @author Martin Pala <martin.pala@hq.iol.cz>
62   *  @author Christian Hopp, <chopp@iei.tu-clausthal.de>   *  @author Christian Hopp, <chopp@iei.tu-clausthal.de>
63   *   *
64   *  @version \$Id$   *  @version \$Id$
# Line 74  static RETSIGTYPE  do_destroy(int); Line 75  static RETSIGTYPE  do_destroy(int);
75  static void  do_default();                              /* Do default action */  static void  do_default();                              /* Do default action */
76  static RETSIGTYPE  do_wakeup(int); /* Signalhandler for a daemon wakeup call */  static RETSIGTYPE  do_wakeup(int); /* Signalhandler for a daemon wakeup call */
77  static int   do_wakeupcall();              /* Wakeup a sleeping monit daemon */  static int   do_wakeupcall();              /* Wakeup a sleeping monit daemon */
78    static RETSIGTYPE do_restart(int sig);   /* Signalhandler for daemon restart */
79  static void  do_wait();                               /* Wait for 10 seconds */  static void  do_wait();                               /* Wait for 10 seconds */
80  static void  handle_options(int, char **);         /* Handle program options */  static void  handle_options(int, char **);         /* Handle program options */
81  static void  help();                 /* Print program help message to stdout */  static void  help();                 /* Print program help message to stdout */
# Line 81  static void  version(); Line 83  static void  version();
83  static void  stop_http();                                 /* Stop monit http */  static void  stop_http();                                 /* Stop monit http */
84  static void  start_http();                               /* Start monit http */  static void  start_http();                               /* Start monit http */
85    
86    
87  /**  /**
88   * The Prime mover   * The Prime mover
89   */   */
# Line 126  static void do_init() { Line 129  static void do_init() {
129    signal(SIGUSR1, do_wakeup);    signal(SIGUSR1, do_wakeup);
130    
131    /*    /*
132       * Register interest for the SIGHUP signal,
133       * in case we run in daemon mode this signal
134       * will restart the monit daemon.
135       */
136      signal(SIGHUP, do_restart);
137    
138      /*
139     * Register no interest for the SIGPIPE signal,     * Register no interest for the SIGPIPE signal,
140     */     */
141    signal(SIGPIPE, SIG_IGN);    signal(SIGPIPE, SIG_IGN);
# Line 385  static RETSIGTYPE do_wakeup(int sig) { Line 395  static RETSIGTYPE do_wakeup(int sig) {
395    
396  }  }
397    
398    
399    /**
400     * Signalhandler for a daemon restart call. The timestamp of the
401     * control file is changed with the effect that a monit daemon will
402     * restart itself, including closing and reopening log files.
403     */
404    static RETSIGTYPE do_restart(int sig) {
405    
406      signal(SIGHUP, SIG_IGN);
407      Run.timestamp= 0;
408      log("Awakened by the SIGHUP signal\n");
409      signal(SIGHUP, do_restart);
410    
411    }
412    
413    
414  /**  /**
415   * Wakeup a sleeping monit daemon.   * Wakeup a sleeping monit daemon.

Legend:
Removed from v.1.38  
changed lines
  Added in v.1.39

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