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

Diff of /monit/p.y

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

revision 1.50 by hauk, Fri Dec 20 23:15:21 2002 UTC revision 1.51 by hauk, Sat Dec 21 01:43:36 2002 UTC
# Line 75  Line 75 
75    struct IHavePrecedence {    struct IHavePrecedence {
76      int daemon;      int daemon;
77      int logfile;      int logfile;
78        int pidfile;
79    };    };
80    
81    struct MailFilter {    struct MailFilter {
# Line 132  Line 133 
133    static Process_T current= NULL;    static Process_T current= NULL;
134    static Command_T command= NULL;    static Command_T command= NULL;
135    static Process_T depend_list= NULL;    static Process_T depend_list= NULL;
136    static struct IHavePrecedence ihp= {FALSE, FALSE};    static struct IHavePrecedence ihp= {FALSE, FALSE, FALSE};
137    static struct MailFilter mtf= {NULL, NULL, NULL, FALSE, FALSE, FALSE,    static struct MailFilter mtf= {NULL, NULL, NULL, FALSE, FALSE, FALSE,
138                                   FALSE, FALSE, FALSE};                                   FALSE, FALSE, FALSE};
139    static struct PortSet portset= {-1, NULL, 0, SOCK_STREAM, AF_INET, FALSE,    static struct PortSet portset= {-1, NULL, 0, SOCK_STREAM, AF_INET, FALSE,
# Line 156  Line 157 
157    static void addcommand(int);    static void addcommand(int);
158    static void addargument(char *);    static void addargument(char *);
159    static void setlogfile(char *);    static void setlogfile(char *);
160      static void setpidfile(char *);
161    static void setmailserver(char *);    static void setmailserver(char *);
162    static void setuname(char *);    static void setuname(char *);
163    static void setpasswd(char *);    static void setpasswd(char *);
# Line 249  optionstatement : start Line 251  optionstatement : start
251                  ;                  ;
252    
253  setdaemon       : SET DAEMON NUMBER  {  setdaemon       : SET DAEMON NUMBER  {
254                     if ( !Run.isdaemon || ihp.daemon ) {                     if (!Run.isdaemon || ihp.daemon) {
255                       ihp.daemon= TRUE;                       ihp.daemon= TRUE;
256                       Run.isdaemon= TRUE;                       Run.isdaemon= TRUE;
257                       Run.polltime= $3;                       Run.polltime= $3;
# Line 263  setinit         : SET INIT { Line 265  setinit         : SET INIT {
265                  ;                  ;
266    
267  setlog          : SET LOGFILE PATH   {  setlog          : SET LOGFILE PATH   {
268                     if ( !Run.logfile || ihp.logfile ) {                     if (!Run.logfile || ihp.logfile) {
269                       ihp.logfile= TRUE;                       ihp.logfile= TRUE;
270                       setlogfile($3);                       setlogfile($3);
271                       Run.use_syslog= FALSE;                       Run.use_syslog= FALSE;
# Line 271  setlog          : SET LOGFILE PATH   { Line 273  setlog          : SET LOGFILE PATH   {
273                     }                     }
274                   }                   }
275                  | SET LOGFILE SYSLOG {                  | SET LOGFILE SYSLOG {
276                     if ( !Run.logfile || ihp.logfile ) {                     if (!Run.logfile || ihp.logfile) {
277                       ihp.logfile= TRUE;                       ihp.logfile= TRUE;
278                       setlogfile(xstrdup("syslog"));                       setlogfile(xstrdup("syslog"));
279                       Run.use_syslog= TRUE;                       Run.use_syslog= TRUE;
# Line 281  setlog          : SET LOGFILE PATH   { Line 283  setlog          : SET LOGFILE PATH   {
283                  ;                  ;
284    
285  setpid          : SET PIDFILE PATH {  setpid          : SET PIDFILE PATH {
286                     Run.pidfile= $3;                     if (!Run.pidfile || ihp.pidfile) {
287                         ihp.pidfile= TRUE;
288                         setpidfile($3);
289                       }
290                   }                   }
291                  ;                  ;
292    
# Line 691  static void initialize() { Line 696  static void initialize() {
696    Run.dolog= FALSE;    Run.dolog= FALSE;
697    Run.dohttpd= FALSE;    Run.dohttpd= FALSE;
698    Run.Auth.defined= FALSE;    Run.Auth.defined= FALSE;
   Run.pidfile= NULL;  
699    Run.servicessl= FALSE;    Run.servicessl= FALSE;
700    Run.clientssl= FALSE;    Run.clientssl= FALSE;
701    reset_runmail();    reset_runmail();
# Line 1099  static void setlogfile(char *logfile) { Line 1103  static void setlogfile(char *logfile) {
1103    
1104  }  }
1105    
1106    
1107    /*
1108     * Reset the pidfil if changed
1109     */
1110    static void setpidfile(char *pidfile) {
1111    
1112      if(Run.pidfile) {
1113        
1114        if(is(Run.pidfile, pidfile)) {
1115          
1116          return;
1117          
1118        } else {
1119          
1120          free(Run.pidfile);
1121          
1122        }
1123      }
1124      
1125      Run.pidfile= pidfile;
1126    
1127    }
1128    
1129    
1130  /*  /*
1131   * Set mailserver if changed   * Set mailserver if changed

Legend:
Removed from v.1.50  
changed lines
  Added in v.1.51

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