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> |
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 { |
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) { |
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 |
|
} |