diff options
author | Bill Nottingham <notting@redhat.com> | 2005-03-31 20:52:04 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2005-03-31 20:52:04 +0000 |
commit | c45ffd7f30263049d6316034119682fd89cedff7 (patch) | |
tree | b5768278fe6a5ac812b173875164053e4bcf911e /src/initlog.c | |
parent | ed25c43e6789cef946d56db177bfdad1a450c587 (diff) | |
download | initscripts-c45ffd7f30263049d6316034119682fd89cedff7.tar initscripts-c45ffd7f30263049d6316034119682fd89cedff7.tar.gz initscripts-c45ffd7f30263049d6316034119682fd89cedff7.tar.bz2 initscripts-c45ffd7f30263049d6316034119682fd89cedff7.tar.xz initscripts-c45ffd7f30263049d6316034119682fd89cedff7.zip |
bring back initlog for third-party scripts. officially deprecate it
Diffstat (limited to 'src/initlog.c')
-rw-r--r-- | src/initlog.c | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/src/initlog.c b/src/initlog.c index 3b1cded6..ccf6375b 100644 --- a/src/initlog.c +++ b/src/initlog.c @@ -168,38 +168,6 @@ char **toArray(char *line, int *num) { return lines; } -int startDaemon() { - int pid; - int rc; - - if ( (pid = fork()) == -1 ) { - perror("fork"); - return -1; - } - if ( pid ) { - /* parent */ - waitpid(pid,&rc,0); - if (WIFEXITED(rc)) { - DDEBUG("minilogd returned %d!\n",WEXITSTATUS(rc)); - return WEXITSTATUS(rc); - } - else - return -1; - } else { - int fd; - - fd=open("/dev/null",O_RDWR); - dup2(fd,0); - dup2(fd,1); - dup2(fd,2); - close(fd); - /* kid */ - execlp("minilogd","minilogd",NULL); - perror("exec"); - exit(-1); - } -} - int trySocket() { int s; struct sockaddr_un addr; @@ -243,9 +211,7 @@ int logLine(struct logInfo *logEnt) { if (!logEnt->line || !strcmp(logEnt->line,"\n")) return 0; - if ( ((stat(_PATH_LOG,&statbuf)==-1) || trySocket()) - && startDaemon() - ) { + if ((stat(_PATH_LOG,&statbuf)==-1) || trySocket()) { DDEBUG("starting daemon failed, pooling entry %d\n",logEntries); logData=realloc(logData,(logEntries+1)*sizeof(struct logInfo)); logData[logEntries]= (*logEnt); @@ -461,5 +427,6 @@ int main(int argc, char **argv) { setlocale(LC_ALL,""); bindtextdomain("initlog","/etc/locale"); textdomain("initlog"); + fprintf(stderr, _("WARNING: initlog is deprecated and will be removed in a future release\n")); exit(processArgs(argc,argv,0)); } |