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

Diff of /monit/monitor.c

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

revision 1.118 by martinp, Thu Jan 6 20:51:49 2005 UTC revision 1.119 by martinp, Sun Feb 13 19:01:45 2005 UTC
# Line 94  static void  do_reinit();           /* R Line 94  static void  do_reinit();           /* R
94  static void  do_action(char **);         /* Dispatch to the submitted action */  static void  do_action(char **);         /* Dispatch to the submitted action */
95  static void  do_exit();                                    /* Finalize monit */  static void  do_exit();                                    /* Finalize monit */
96  static void  do_default();                              /* Do default action */  static void  do_default();                              /* Do default action */
 static int   do_wakeupcall();              /* Wakeup a sleeping monit daemon */  
97  static void  handle_options(int, char **);         /* Handle program options */  static void  handle_options(int, char **);         /* Handle program options */
98  static void  help();                 /* Print program help message to stdout */  static void  help();                 /* Print program help message to stdout */
99  static void  version();                         /* Print version information */  static void  version();                         /* Print version information */
# Line 124  int main(int argc, char **argv) { Line 123  int main(int argc, char **argv) {
123  }  }
124    
125    
126    /**
127     * Wakeup a sleeping monit daemon.
128     * Returns TRUE on success otherwise FALSE
129     */
130    int do_wakeupcall() {
131    
132      pid_t pid;
133      
134      if((pid= exist_daemon()) > 0) {
135        
136        kill(pid, SIGUSR1);
137        log("%s daemon at %d awakened\n", prog, pid);
138        
139        return TRUE;
140        
141      }
142      
143      return FALSE;
144      
145    }
146    
147    
148  /* ----------------------------------------------------------------- Private */  /* ----------------------------------------------------------------- Private */
149    
150    
# Line 373  static void do_action(char **args) { Line 394  static void do_action(char **args) {
394        
395  }  }
396    
   
 /**  
  * Wakeup a sleeping monit daemon.  
  * Returns TRUE on success otherwise FALSE  
  */  
 static int do_wakeupcall() {  
   
   pid_t pid;  
     
   if((pid= exist_daemon()) > 0) {  
       
     kill(pid, SIGUSR1);  
     log("%s daemon at %d awakened\n", prog, pid);  
       
     return TRUE;  
       
   }  
     
   return FALSE;  
     
 }  
   
397    
398  /**  /**
399   * Finalize monit   * Finalize monit

Legend:
Removed from v.1.118  
changed lines
  Added in v.1.119

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