aboutsummaryrefslogtreecommitdiffstats
path: root/src/initlog.c
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-03-31 20:52:04 +0000
committerBill Nottingham <notting@redhat.com>2005-03-31 20:52:04 +0000
commitc45ffd7f30263049d6316034119682fd89cedff7 (patch)
treeb5768278fe6a5ac812b173875164053e4bcf911e /src/initlog.c
parented25c43e6789cef946d56db177bfdad1a450c587 (diff)
downloadinitscripts-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.c37
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));
}