Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/runit/svlogd.c
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/runit/svlogd.c
r2725 r3232 126 126 */ 127 127 128 //usage:#define svlogd_trivial_usage 129 //usage: "[-ttv] [-r C] [-R CHARS] [-l MATCHLEN] [-b BUFLEN] DIR..." 130 //usage:#define svlogd_full_usage "\n\n" 131 //usage: "Continuously read log data from stdin and write to rotated log files in DIRs" 132 //usage: "\n" 133 //usage: "\n""DIR/config file modifies behavior:" 134 //usage: "\n""sSIZE - when to rotate logs" 135 //usage: "\n""nNUM - number of files to retain" 136 /*usage: "\n""NNUM - min number files to retain" - confusing */ 137 /*usage: "\n""tSEC - rotate file if it get SEC seconds old" - confusing */ 138 //usage: "\n""!PROG - process rotated log with PROG" 139 /*usage: "\n""uIPADDR - send log over UDP" - unsupported */ 140 /*usage: "\n""UIPADDR - send log over UDP and DONT log" - unsupported */ 141 /*usage: "\n""pPFX - prefix each line with PFX" - unsupported */ 142 //usage: "\n""+,-PATTERN - (de)select line for logging" 143 //usage: "\n""E,ePATTERN - (de)select line for stderr" 144 128 145 #include <sys/poll.h> 129 146 #include <sys/file.h> … … 171 188 172 189 void* (*memRchr)(const void *, int, size_t); 190 char *shell; 173 191 174 192 smallint exitasap; … … 366 384 sv_ch = ld->fnsave[26]; 367 385 386 if (!G.shell) 387 G.shell = xstrdup(get_shell_name()); 388 368 389 while ((pid = vfork()) == -1) 369 390 pause2cannot("vfork for processor", ld->name); … … 400 421 xmove_fd(fd, 5); 401 422 402 // getenv("SHELL")? 403 execl(DEFAULT_SHELL, DEFAULT_SHELL_SHORT_NAME, "-c", ld->processor, (char*) NULL); 423 execl(G.shell, G.shell, "-c", ld->processor, (char*) NULL); 404 424 bb_perror_msg_and_die(FATAL"can't %s processor %s", "run", ld->name); 405 425 } … … 582 602 while (fchdir(ld->fddir) == -1) 583 603 pause2cannot("change directory, want remove old logfile", 584 604 ld->name); 585 605 oldest[0] = 'A'; 586 606 oldest[1] = oldest[27] = '\0'; 587 607 while (!(d = opendir("."))) 588 608 pause2cannot("open directory, want remove old logfile", 589 609 ld->name); 590 610 errno = 0; 591 611 while ((f = readdir(d)))
Note:
See TracChangeset
for help on using the changeset viewer.