Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/runit/svlogd.c


Ignore:
Timestamp:
Jan 1, 2014, 12:47:38 AM (10 years ago)
Author:
Bruno Cornec
Message:
  • Update mindi-busybox to 1.21.1
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2/mindi-busybox/runit/svlogd.c

    r2725 r3232  
    126126*/
    127127
     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
    128145#include <sys/poll.h>
    129146#include <sys/file.h>
     
    171188
    172189    void* (*memRchr)(const void *, int, size_t);
     190    char *shell;
    173191
    174192    smallint exitasap;
     
    366384    sv_ch = ld->fnsave[26];
    367385
     386    if (!G.shell)
     387        G.shell = xstrdup(get_shell_name());
     388
    368389    while ((pid = vfork()) == -1)
    369390        pause2cannot("vfork for processor", ld->name);
     
    400421        xmove_fd(fd, 5);
    401422
    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);
    404424        bb_perror_msg_and_die(FATAL"can't %s processor %s", "run", ld->name);
    405425    }
     
    582602            while (fchdir(ld->fddir) == -1)
    583603                pause2cannot("change directory, want remove old logfile",
    584                              ld->name);
     604                            ld->name);
    585605            oldest[0] = 'A';
    586606            oldest[1] = oldest[27] = '\0';
    587607            while (!(d = opendir(".")))
    588608                pause2cannot("open directory, want remove old logfile",
    589                              ld->name);
     609                            ld->name);
    590610            errno = 0;
    591611            while ((f = readdir(d)))
Note: See TracChangeset for help on using the changeset viewer.