142 |
extern char *yytext; |
extern char *yytext; |
143 |
|
|
144 |
/* Local variables */ |
/* Local variables */ |
145 |
static Process_T tail= NULL; |
static Service_T tail= NULL; |
146 |
static int cfg_errflag= FALSE; |
static int cfg_errflag= FALSE; |
147 |
static Process_T current= NULL; |
static Service_T current= NULL; |
148 |
static Command_T command= NULL; |
static Command_T command= NULL; |
149 |
static Process_T depend_list= NULL; |
static Service_T depend_list= NULL; |
150 |
static struct IHavePrecedence ihp= {FALSE, FALSE, FALSE}; |
static struct IHavePrecedence ihp= {FALSE, FALSE, FALSE}; |
151 |
static struct MailFilter mtf= {NULL, NULL, NULL, FALSE, FALSE, FALSE, |
static struct MailFilter mtf= {NULL, NULL, NULL, FALSE, FALSE, FALSE, |
152 |
FALSE, FALSE, FALSE}; |
FALSE, FALSE, FALSE}; |
160 |
|
|
161 |
/* Private prototypes */ |
/* Private prototypes */ |
162 |
static void initialize(); |
static void initialize(); |
163 |
static void addprocess(Process_T); |
static void addservice(Service_T); |
164 |
static void addmail(char *, struct MailFilter *); |
static void addmail(char *, struct MailFilter *); |
165 |
static void createprocess(int, char *, char *); |
static void createservice(int, char *, char *); |
166 |
static void adddependant(char *); |
static void adddependant(char *); |
167 |
static void addchecksum(char *, char *); |
static void addchecksum(char *, char *); |
168 |
static void addport(struct PortSet *); |
static void addport(struct PortSet *); |
194 |
static char *append_hostname(char *); |
static char *append_hostname(char *); |
195 |
static void cleanup_md5_string(char *); |
static void cleanup_md5_string(char *); |
196 |
static void check_depend(); |
static void check_depend(); |
197 |
static void order_depend(Process_T); |
static void order_depend(Service_T); |
198 |
static void validate_depend(Process_T, int *); |
static void validate_depend(Service_T, int *); |
199 |
static void init_syslog(char *); |
static void setsyslog(char *); |
200 |
%} |
%} |
201 |
|
|
202 |
%union { |
%union { |
207 |
|
|
208 |
%token SET LOGFILE DAEMON SYSLOG MAILSERVER HTTPD ALLOW ADDRESS INIT |
%token SET LOGFILE DAEMON SYSLOG MAILSERVER HTTPD ALLOW ADDRESS INIT |
209 |
%token PEMFILE ENABLE DISABLE HTTPDSSL CLIENTPEMFILE ALLOWSELFCERTIFICATION |
%token PEMFILE ENABLE DISABLE HTTPDSSL CLIENTPEMFILE ALLOWSELFCERTIFICATION |
210 |
|
%token STATEFILE |
211 |
%token CHECK PIDFILE START STOP PATHTOK |
%token CHECK PIDFILE START STOP PATHTOK |
212 |
%token HOST PORT TYPE UDP TCP TCPSSL PROTOCOL FACILITY |
%token HOST PORT TYPE UDP TCP TCPSSL PROTOCOL FACILITY |
213 |
%token ALERT MAILFORMAT UNIXSOCKET |
%token ALERT MAILFORMAT UNIXSOCKET |
216 |
%token <string> STRING PATH MAILADDR MAILFROM MAILSUBJECT |
%token <string> STRING PATH MAILADDR MAILFROM MAILSUBJECT |
217 |
%token <string> MAILBODY |
%token <string> MAILBODY |
218 |
%token <number> NUMBER PERCENT |
%token <number> NUMBER PERCENT |
219 |
%token <real> REAL |
%token <real> REAL |
220 |
%token CPUUSAGE MEMUSAGE MEMKBYTE TOTALMEMKBYTE TOTALMEMUSAGE CHILDREN |
%token CPUUSAGE MEMUSAGE MEMKBYTE TOTALMEMKBYTE TOTALMEMUSAGE CHILDREN |
221 |
%token RESOURCE MEMORY TOTALMEMORY CPU LOADAVG1 LOADAVG5 LOADAVG15 |
%token RESOURCE MEMORY TOTALMEMORY CPU LOADAVG1 LOADAVG5 LOADAVG15 |
222 |
%token AUTOSTART MODE ACTIVE PASSIVE MANUAL |
%token AUTOSTART MODE ACTIVE PASSIVE MANUAL |
245 |
| setmailformat |
| setmailformat |
246 |
| sethttpd |
| sethttpd |
247 |
| setpid |
| setpid |
248 |
|
| setstate |
249 |
| setinit |
| setinit |
250 |
| checkproc optproclist |
| checkproc optproclist |
251 |
| checkfile optfilelist |
| checkfile optfilelist |
365 |
Run.dolog=TRUE; |
Run.dolog=TRUE; |
366 |
} |
} |
367 |
} |
} |
368 |
| SET LOGFILE SYSLOG { init_syslog(NULL); } |
| SET LOGFILE SYSLOG { setsyslog(NULL); } |
369 |
| SET LOGFILE SYSLOG FACILITY STRING { |
| SET LOGFILE SYSLOG FACILITY STRING { |
370 |
init_syslog($5); free($5); |
setsyslog($5); free($5); |
371 |
} |
} |
372 |
; |
; |
373 |
|
|
374 |
|
setstate : SET STATEFILE PATH { |
375 |
|
Run.statefile= $3; |
376 |
|
} |
377 |
|
; |
378 |
|
|
379 |
setpid : SET PIDFILE PATH { |
setpid : SET PIDFILE PATH { |
380 |
if(!Run.pidfile || ihp.pidfile) { |
if(!Run.pidfile || ihp.pidfile) { |
381 |
ihp.pidfile= TRUE; |
ihp.pidfile= TRUE; |
413 |
} |
} |
414 |
; |
; |
415 |
|
|
|
|
|
416 |
httpdlist : /* EMPTY */ |
httpdlist : /* EMPTY */ |
417 |
| httpdlist httpdoption |
| httpdlist httpdoption |
418 |
; |
; |
491 |
; |
; |
492 |
|
|
493 |
checkproc : CHECK PROCESS STRING PIDFILE PATH { |
checkproc : CHECK PROCESS STRING PIDFILE PATH { |
494 |
createprocess(TASK_PROCESS, $3,$5); |
createservice(TASK_PROCESS, $3,$5); |
495 |
check_name($3); |
check_name($3); |
496 |
} |
} |
497 |
| CHECK PROCESS STRING PATHTOK PATH { |
| CHECK PROCESS STRING PATHTOK PATH { |
498 |
createprocess(TASK_PROCESS, $3,$5); |
createservice(TASK_PROCESS, $3,$5); |
499 |
check_name($3); |
check_name($3); |
500 |
} |
} |
501 |
| CHECK STRING PIDFILE PATH { |
| CHECK STRING PIDFILE PATH { |
502 |
createprocess(TASK_PROCESS, $2,$4); |
createservice(TASK_PROCESS, $2,$4); |
503 |
check_name($2); |
check_name($2); |
504 |
} |
} |
505 |
; |
; |
506 |
|
|
507 |
checkfile : CHECK FILETOK STRING PATHTOK PATH { |
checkfile : CHECK FILETOK STRING PATHTOK PATH { |
508 |
createprocess(TASK_FILE, $3,$5); |
createservice(TASK_FILE, $3,$5); |
509 |
check_name($3); |
check_name($3); |
510 |
} |
} |
511 |
; |
; |
512 |
|
|
513 |
checkdev : CHECK DEVICE STRING PATHTOK PATH { |
checkdev : CHECK DEVICE STRING PATHTOK PATH { |
514 |
createprocess(TASK_DEVICE, $3,$5); |
createservice(TASK_DEVICE, $3,$5); |
515 |
check_name($3); |
check_name($3); |
516 |
} |
} |
517 |
; |
; |
518 |
|
|
519 |
checkdir : CHECK DIRECTORY STRING PATHTOK PATH { |
checkdir : CHECK DIRECTORY STRING PATHTOK PATH { |
520 |
createprocess(TASK_DIRECTORY, $3,$5); |
createservice(TASK_DIRECTORY, $3,$5); |
521 |
check_name($3); |
check_name($3); |
522 |
} |
} |
523 |
; |
; |
709 |
| MEMORY operator PERCENT { |
| MEMORY operator PERCENT { |
710 |
resourceset.resource_id= RESOURCE_ID_MEM_PERCENT; |
resourceset.resource_id= RESOURCE_ID_MEM_PERCENT; |
711 |
resourceset.operator= $<number>2; |
resourceset.operator= $<number>2; |
712 |
resourceset.limit= (int) ($<number>3 * 10.0); |
resourceset.limit= (int) ($<number>3 * 10); |
713 |
} |
} |
714 |
| TOTALMEMORY operator value unit { |
| TOTALMEMORY operator value unit { |
715 |
resourceset.resource_id= RESOURCE_ID_TOTAL_MEM_KBYTE; |
resourceset.resource_id= RESOURCE_ID_TOTAL_MEM_KBYTE; |
720 |
| TOTALMEMORY operator PERCENT { |
| TOTALMEMORY operator PERCENT { |
721 |
resourceset.resource_id= RESOURCE_ID_TOTAL_MEM_PERCENT; |
resourceset.resource_id= RESOURCE_ID_TOTAL_MEM_PERCENT; |
722 |
resourceset.operator= $<number>2; |
resourceset.operator= $<number>2; |
723 |
resourceset.limit= (int) ($<number>3 * 10.0); |
resourceset.limit= (int) ($<number>3 * 10); |
724 |
} |
} |
725 |
| CPU operator PERCENT { |
| CPU operator PERCENT { |
726 |
resourceset.resource_id= RESOURCE_ID_CPU_PERCENT; |
resourceset.resource_id= RESOURCE_ID_CPU_PERCENT; |
727 |
resourceset.operator= $<number>2; |
resourceset.operator= $<number>2; |
728 |
resourceset.limit= (int) ($<number>3 * 10.0); |
resourceset.limit= (int) ($<number>3 * 10); |
729 |
} |
} |
730 |
/* Remaining syntax */ |
/* Remaining syntax */ |
731 |
| CHILDREN operator NUMBER { |
| CHILDREN operator NUMBER { |
854 |
|
|
855 |
ASSERT(controlfile); |
ASSERT(controlfile); |
856 |
|
|
857 |
processlist= tail= current= NULL; |
servicelist= tail= current= NULL; |
858 |
|
|
859 |
if(! check_rcfile(controlfile)) { |
if(! check_rcfile(controlfile)) { |
860 |
|
|
870 |
|
|
871 |
} |
} |
872 |
|
|
873 |
/* Creation of the global process list is synchronized */ |
/* Creation of the global service list is synchronized */ |
874 |
LOCK(Run.mutex) |
LOCK(Run.mutex) |
875 |
|
|
876 |
initialize(); |
initialize(); |
877 |
yyparse(); |
yyparse(); |
878 |
fclose(yyin); |
fclose(yyin); |
879 |
|
|
880 |
/* If defined - add the last process to the process list */ |
/* If defined - add the last service to the service list */ |
881 |
if(current) { |
if(current) { |
882 |
|
|
883 |
createinfo(); |
createinfo(); |
884 |
addprocess(current); |
addservice(current); |
885 |
|
|
886 |
} |
} |
887 |
|
|
922 |
|
|
923 |
|
|
924 |
/* |
/* |
925 |
* Create a new process object and add any current objects to the |
* Create a new service object and add any current objects to the |
926 |
* process list. |
* service list. |
927 |
*/ |
*/ |
928 |
static void createprocess(int task, char *name, char *path) { |
static void createservice(int task, char *name, char *path) { |
929 |
|
|
930 |
ASSERT(name); |
ASSERT(name); |
931 |
ASSERT(path); |
ASSERT(path); |
933 |
if(current) { |
if(current) { |
934 |
|
|
935 |
createinfo(); |
createinfo(); |
936 |
addprocess(current); |
addservice(current); |
937 |
|
|
938 |
} |
} |
939 |
else { |
else { |
962 |
|
|
963 |
|
|
964 |
/* |
/* |
965 |
* Add a process object to the processlist |
* Add a service object to the servicelist |
966 |
*/ |
*/ |
967 |
static void addprocess(Process_T p) { |
static void addservice(Service_T s) { |
968 |
|
|
969 |
Process_T n; |
Service_T n; |
970 |
|
|
971 |
ASSERT(p); |
ASSERT(s); |
972 |
|
|
973 |
n= NEW(n); |
n= NEW(n); |
974 |
memcpy(n, p, sizeof(*p)); |
memcpy(n, s, sizeof(*s)); |
975 |
|
|
976 |
/* Add the process to the end of the process list */ |
/* Add the service to the end of the service list */ |
977 |
if(tail != NULL) { |
if(tail != NULL) { |
978 |
|
|
979 |
tail->next= n; |
tail->next= n; |
980 |
|
|
981 |
} else { |
} else { |
982 |
|
|
983 |
processlist= n; |
servicelist= n; |
984 |
|
|
985 |
} |
} |
986 |
|
|
990 |
|
|
991 |
|
|
992 |
/* |
/* |
993 |
* Add a dependant entry to the current process dependant list |
* Add a dependant entry to the current service dependant list |
994 |
* |
* |
995 |
*/ |
*/ |
996 |
static void adddependant(char *dependant) { |
static void adddependant(char *dependant) { |
1011 |
|
|
1012 |
/* |
/* |
1013 |
* Add a filename and its associated md5 checksum |
* Add a filename and its associated md5 checksum |
1014 |
* to the current process checksumlist |
* to the current service checksumlist |
1015 |
*/ |
*/ |
1016 |
static void addchecksum(char *filename, char *sum) { |
static void addchecksum(char *filename, char *sum) { |
1017 |
|
|
1050 |
/* |
/* |
1051 |
* Add the given mailaddress with the apropriate alert notification |
* Add the given mailaddress with the apropriate alert notification |
1052 |
* mask { TIMEOUT RESTART CHECKSUM RESOURCE STOP TIMESTAMP } and mail |
* mask { TIMEOUT RESTART CHECKSUM RESOURCE STOP TIMESTAMP } and mail |
1053 |
* attributes to the current process's mailinglist. |
* attributes to the current service's mailinglist. |
1054 |
*/ |
*/ |
1055 |
static void addmail(char *mailto, struct MailFilter *f) { |
static void addmail(char *mailto, struct MailFilter *f) { |
1056 |
|
|
1098 |
|
|
1099 |
|
|
1100 |
/* |
/* |
1101 |
* Add the given portset to the current process's portlist |
* Add the given portset to the current service's portlist |
1102 |
*/ |
*/ |
1103 |
static void addport(struct PortSet *pp) { |
static void addport(struct PortSet *pp) { |
1104 |
|
|
1161 |
|
|
1162 |
|
|
1163 |
/* |
/* |
1164 |
* Add a new resource object to the current process resource list |
* Add a new resource object to the current service resource list |
1165 |
*/ |
*/ |
1166 |
static void addresource(struct ResourceSet *rr) { |
static void addresource(struct ResourceSet *rr) { |
1167 |
|
|
1171 |
|
|
1172 |
if(! Run.doprocess) { |
if(! Run.doprocess) { |
1173 |
|
|
1174 |
log("%s: Cannot activate process check at line %d\n" |
log("%s: Cannot activate service check at line %d\n" |
1175 |
"\t(The process status engine was disabled. On certain" |
"\t(The process status engine was disabled. On certain" |
1176 |
" systems you must\n\trun monit as root to utilize this" |
" systems you must\n\trun monit as root to utilize this" |
1177 |
" feature)\n", prog, lineno-1); |
" feature)\n", prog, lineno-1); |
1202 |
|
|
1203 |
|
|
1204 |
/* |
/* |
1205 |
* Add a new file object to the current process timestamp list |
* Add a new file object to the current service timestamp list |
1206 |
*/ |
*/ |
1207 |
static void addtimestamp(struct TimestampSet *ts) { |
static void addtimestamp(struct TimestampSet *ts) { |
1208 |
|
|
1247 |
|
|
1248 |
|
|
1249 |
/* |
/* |
1250 |
* Adds runtime info to current process |
* Adds runtime info to current service |
1251 |
*/ |
*/ |
1252 |
static void createinfo() { |
static void createinfo() { |
1253 |
|
|
1286 |
|
|
1287 |
|
|
1288 |
/* |
/* |
1289 |
* Add the current command object to the current process object |
* Add the current command object to the current service object |
1290 |
*/ |
*/ |
1291 |
static void addcommand(int what) { |
static void addcommand(int what) { |
1292 |
|
|
1579 |
|
|
1580 |
|
|
1581 |
/* |
/* |
1582 |
|
* Set the syslog and the facilities to be used |
1583 |
|
*/ |
1584 |
|
static void setsyslog(char *facility) { |
1585 |
|
|
1586 |
|
if (!Run.logfile || ihp.logfile) { |
1587 |
|
|
1588 |
|
ihp.logfile= TRUE; |
1589 |
|
setlogfile(xstrdup("syslog")); |
1590 |
|
Run.use_syslog= TRUE; |
1591 |
|
Run.dolog=TRUE; |
1592 |
|
|
1593 |
|
} |
1594 |
|
|
1595 |
|
if(facility) { |
1596 |
|
if(IS(facility,"log_local0")) { |
1597 |
|
Run.facility = LOG_LOCAL0; |
1598 |
|
} else if(IS(facility, "log_local1")) { |
1599 |
|
Run.facility = LOG_LOCAL1; |
1600 |
|
} else if(IS(facility, "log_local2")) { |
1601 |
|
Run.facility = LOG_LOCAL2; |
1602 |
|
} else if(IS(facility, "log_local3")) { |
1603 |
|
Run.facility = LOG_LOCAL3; |
1604 |
|
} else if(IS(facility, "log_local4")) { |
1605 |
|
Run.facility = LOG_LOCAL4; |
1606 |
|
} else if(IS(facility, "log_local5")) { |
1607 |
|
Run.facility = LOG_LOCAL5; |
1608 |
|
} else if(IS(facility, "log_local6")) { |
1609 |
|
Run.facility = LOG_LOCAL6; |
1610 |
|
} else if(IS(facility, "log_local7")) { |
1611 |
|
Run.facility = LOG_LOCAL7; |
1612 |
|
} else if(IS(facility, "log_daemon")) { |
1613 |
|
Run.facility = LOG_DAEMON; |
1614 |
|
} else { |
1615 |
|
log("Invalid syslog facility '%s' used at line %d\n", facility, lineno); |
1616 |
|
cfg_errflag++; |
1617 |
|
} |
1618 |
|
} else { |
1619 |
|
Run.facility= LOG_USER; |
1620 |
|
} |
1621 |
|
|
1622 |
|
} |
1623 |
|
|
1624 |
|
|
1625 |
|
/* |
1626 |
* Reset the Mail filter to default values |
* Reset the Mail filter to default values |
1627 |
*/ |
*/ |
1628 |
static void reset_mailfilter() { |
static void reset_mailfilter() { |
1720 |
|
|
1721 |
|
|
1722 |
/* |
/* |
1723 |
* Check for unique process name |
* Check for unique service name |
1724 |
*/ |
*/ |
1725 |
static void check_name(char *name) { |
static void check_name(char *name) { |
1726 |
|
|
1727 |
ASSERT(name); |
ASSERT(name); |
1728 |
|
|
1729 |
if(exist_process(name)) { |
if(exist_service(name)) { |
1730 |
|
|
1731 |
log("%s: Name conflict at line %d - check name '%s' already defined\n", |
log("%s: Name conflict at line %d - check name '%s' already defined\n", |
1732 |
prog, lineno, name); |
prog, lineno, name); |
1753 |
|
|
1754 |
if( *status != '\0' || result < 0 || result > 07777 ) { |
if( *status != '\0' || result < 0 || result > 07777 ) { |
1755 |
|
|
1756 |
yyerror("An permission statement must have an octal value between 0 and 07777."); |
yyerror("An permission statement must have an octal value between 0 " |
1757 |
|
"and 07777."); |
1758 |
|
|
1759 |
} |
} |
1760 |
|
|
1815 |
|
|
1816 |
/* |
/* |
1817 |
* Check the dependency graph for errors and if dependencies are |
* Check the dependency graph for errors and if dependencies are |
1818 |
* present reshuffle the process list in a depending order. |
* present reshuffle the service list in a depending order. |
1819 |
*/ |
*/ |
1820 |
static void check_depend() { |
static void check_depend() { |
1821 |
|
|
1822 |
Process_T p; |
Service_T s; |
1823 |
int has_depend= FALSE; |
int has_depend= FALSE; |
1824 |
|
|
1825 |
for (p= processlist; p; p= p->next) { |
for(s= servicelist; s; s= s->next) { |
1826 |
if(p->visited) |
if(s->visited) |
1827 |
continue; |
continue; |
1828 |
validate_depend(p, &has_depend); |
validate_depend(s, &has_depend); |
1829 |
reset_depend(); |
reset_depend(); |
1830 |
} |
} |
1831 |
|
|
1832 |
if(has_depend) { |
if(has_depend) { |
1833 |
|
|
1834 |
Process_T d; |
Service_T d; |
1835 |
|
|
1836 |
for (p= processlist; p; p= p->next) { |
for(s= servicelist; s; s= s->next) { |
1837 |
if(p->visited) |
if(s->visited) |
1838 |
continue; |
continue; |
1839 |
order_depend(p); |
order_depend(s); |
1840 |
} |
} |
1841 |
|
|
1842 |
ASSERT(depend_list); |
ASSERT(depend_list); |
1843 |
processlist= depend_list; |
servicelist= depend_list; |
1844 |
|
|
1845 |
for(d= depend_list; d; d= d->next_depend) |
for(d= depend_list; d; d= d->next_depend) |
1846 |
d->next= d->next_depend; |
d->next= d->next_depend; |
1909 |
|
|
1910 |
|
|
1911 |
/* |
/* |
1912 |
* Search for any errors in the process dependency graph |
* Search for any errors in the service dependency graph |
1913 |
*/ |
*/ |
1914 |
static void validate_depend(Process_T p, int *has_depend) { |
static void validate_depend(Service_T s, int *has_depend) { |
1915 |
|
|
1916 |
ASSERT(p); |
ASSERT(s); |
1917 |
|
|
1918 |
if(p->visited) |
if(s->visited) |
1919 |
return; |
return; |
1920 |
|
|
1921 |
if(p->dependantlist) { |
if(s->dependantlist) { |
1922 |
|
|
1923 |
Dependant_T d; |
Dependant_T d; |
1924 |
|
|
1925 |
for(d= p->dependantlist; d; d= d->next) { |
for(d= s->dependantlist; d; d= d->next) { |
1926 |
|
|
1927 |
Process_T dp= get_process(d->dependant); |
Service_T dp= get_service(d->dependant); |
1928 |
|
|
1929 |
if(!dp) { |
if(!dp) { |
1930 |
log("%s: Error, depend process '%s' is not defined in the " |
log("%s: Error, depend service '%s' is not defined in the " |
1931 |
"control file\n", prog, d->dependant); |
"control file\n", prog, d->dependant); |
1932 |
exit(1); |
exit(1); |
1933 |
} |
} |
1934 |
|
|
1935 |
if(dp->depend_visited) { |
if(dp->depend_visited) { |
1936 |
log("%s: Error, found a depend loop in the control file involving " |
log("%s: Error, found a depend loop in the control file involving " |
1937 |
"the process '%s'\n", prog, p->name); |
"the service '%s'\n", prog, s->name); |
1938 |
exit(1); |
exit(1); |
1939 |
} |
} |
1940 |
|
|
1945 |
} |
} |
1946 |
} |
} |
1947 |
|
|
1948 |
p->visited= TRUE; |
s->visited= TRUE; |
1949 |
|
|
1950 |
} |
} |
1951 |
|
|
1952 |
|
|
1953 |
/* |
/* |
1954 |
* Order the process list with the most "depending" process last and |
* Order the service list with the most "depending" service last and |
1955 |
* the least first. |
* the least first. |
1956 |
*/ |
*/ |
1957 |
static void order_depend(Process_T p) { |
static void order_depend(Service_T s) { |
1958 |
|
|
1959 |
ASSERT(p); |
ASSERT(s); |
1960 |
|
|
1961 |
if(p->visited) |
if(s->visited) |
1962 |
return; |
return; |
1963 |
|
|
1964 |
p->visited= TRUE; |
s->visited= TRUE; |
1965 |
|
|
1966 |
if(p->dependantlist) { |
if(s->dependantlist) { |
1967 |
|
|
1968 |
Dependant_T d; |
Dependant_T d; |
1969 |
|
|
1970 |
for(d= p->dependantlist; d; d= d->next) { |
for(d= s->dependantlist; d; d= d->next) { |
1971 |
|
|
1972 |
Process_T dp= get_process(d->dependant); |
Service_T dp= get_service(d->dependant); |
1973 |
|
|
1974 |
order_depend(dp); |
order_depend(dp); |
1975 |
|
|
1976 |
} |
} |
1977 |
} |
} |
1978 |
|
|
1979 |
p->next_depend= depend_list; |
s->next_depend= depend_list; |
1980 |
depend_list= p; |
depend_list= s; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void init_syslog(char *facility) { |
|
|
|
|
|
if (!Run.logfile || ihp.logfile) { |
|
|
|
|
|
ihp.logfile= TRUE; |
|
|
setlogfile(xstrdup("syslog")); |
|
|
Run.use_syslog= TRUE; |
|
|
Run.dolog=TRUE; |
|
|
|
|
|
} |
|
1981 |
|
|
|
if(facility) { |
|
|
if(IS(facility,"log_local0")) { |
|
|
Run.facility = LOG_LOCAL0; |
|
|
} else if(IS(facility, "log_local1")) { |
|
|
Run.facility = LOG_LOCAL1; |
|
|
} else if(IS(facility, "log_local2")) { |
|
|
Run.facility = LOG_LOCAL2; |
|
|
} else if(IS(facility, "log_local3")) { |
|
|
Run.facility = LOG_LOCAL3; |
|
|
} else if(IS(facility, "log_local4")) { |
|
|
Run.facility = LOG_LOCAL4; |
|
|
} else if(IS(facility, "log_local5")) { |
|
|
Run.facility = LOG_LOCAL5; |
|
|
} else if(IS(facility, "log_local6")) { |
|
|
Run.facility = LOG_LOCAL6; |
|
|
} else if(IS(facility, "log_local7")) { |
|
|
Run.facility = LOG_LOCAL7; |
|
|
} else if(IS(facility, "log_daemon")) { |
|
|
Run.facility = LOG_DAEMON; |
|
|
} else { |
|
|
log("Invalid syslog facility '%s' used at line %d\n", facility, lineno); |
|
|
cfg_errflag++; |
|
|
} |
|
|
} else { |
|
|
Run.facility= LOG_USER; |
|
|
} |
|
|
|
|
1982 |
} |
} |