/[monit]/monit/p.y
ViewVC logotype

Diff of /monit/p.y

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

revision 1.62 by hauk, Wed Apr 30 23:56:35 2003 UTC revision 1.63 by rory, Wed Jun 4 01:38:14 2003 UTC
# Line 40  Line 40 
40  #include <ctype.h>  #include <ctype.h>
41  #include <pwd.h>  #include <pwd.h>
42  #include <grp.h>  #include <grp.h>
43    #include <syslog.h>
44        
45  #ifdef HAVE_SYS_TYPES_H  #ifdef HAVE_SYS_TYPES_H
46  #include <sys/types.h>  #include <sys/types.h>
# Line 181  Line 182 
182    static void check_depend();    static void check_depend();
183    static void order_depend(Process_T);    static void order_depend(Process_T);
184    static void validate_depend(Process_T, int *);    static void validate_depend(Process_T, int *);
185      static void init_syslog();
186  %}  %}
187    
188  %union {  %union {
# Line 280  setlog          : SET LOGFILE PATH   { Line 282  setlog          : SET LOGFILE PATH   {
282                     }                     }
283                   }                   }
284                  | SET LOGFILE SYSLOG {                  | SET LOGFILE SYSLOG {
285                     if (!Run.logfile || ihp.logfile) {                    init_syslog();
286                       ihp.logfile= TRUE;                    Run.facility = LOG_USER;
287                       setlogfile(xstrdup("syslog"));                  }
288                       Run.use_syslog= TRUE;                  | SET LOGFILE SYSLOG NUMBER {
289                       Run.dolog=TRUE;                    init_syslog();
290                     }                    switch ( $4 ) {
291                   }                    case 0:
292                  ;                      Run.facility = LOG_LOCAL0;
293                        break;
294                      case 1:
295                        Run.facility = LOG_LOCAL1;
296                        break;
297                      case 2:
298                        Run.facility = LOG_LOCAL2;
299                        break;
300                      case 3:
301                        Run.facility = LOG_LOCAL3;
302                        break;
303                      case 4:
304                        Run.facility = LOG_LOCAL4;
305                        break;
306                      case 5:
307                        Run.facility = LOG_LOCAL5;
308                        break;
309                      case 6:
310                        Run.facility = LOG_LOCAL6;
311                        break;
312                      case 7:
313                        Run.facility = LOG_LOCAL7;
314                        break;
315                      default:
316                        printf("Invalid facility given %d\n", $4);
317                        exit(1);
318                      }
319                    }
320                    ;
321    
322  setpid          : SET PIDFILE PATH {  setpid          : SET PIDFILE PATH {
323                     if (!Run.pidfile || ihp.pidfile) {                     if (!Run.pidfile || ihp.pidfile) {
# Line 1670  static void order_depend(Process_T p) { Line 1700  static void order_depend(Process_T p) {
1700    depend_list= p;    depend_list= p;
1701    
1702  }  }
1703    
1704    static void init_syslog() {
1705    
1706      if (!Run.logfile || ihp.logfile) {
1707    
1708        ihp.logfile= TRUE;
1709        setlogfile(xstrdup("syslog"));
1710        Run.use_syslog= TRUE;
1711        Run.dolog=TRUE;
1712    
1713      }
1714    }

Legend:
Removed from v.1.62  
changed lines
  Added in v.1.63

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