aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>1999-03-16 07:42:15 +0000
committerBill Nottingham <notting@redhat.com>1999-03-16 07:42:15 +0000
commit56078108f100bc16b8aeb5e8d2c2a668a3d8dc4d (patch)
treee103d123c5a33d88885be15ceacc47ddf67544d3 /src/process.c
parent724fd6732635659c6c313b5e5590b4ef4da97d22 (diff)
downloadinitscripts-56078108f100bc16b8aeb5e8d2c2a668a3d8dc4d.tar
initscripts-56078108f100bc16b8aeb5e8d2c2a668a3d8dc4d.tar.gz
initscripts-56078108f100bc16b8aeb5e8d2c2a668a3d8dc4d.tar.bz2
initscripts-56078108f100bc16b8aeb5e8d2c2a668a3d8dc4d.tar.xz
initscripts-56078108f100bc16b8aeb5e8d2c2a668a3d8dc4d.zip
if we are 'in initlog' rewrite output so it goes to initlog
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/process.c b/src/process.c
index f52ade06..c4b24473 100644
--- a/src/process.c
+++ b/src/process.c
@@ -141,8 +141,17 @@ int monitor(char *cmdname, int pid, int numfds, int *fds, int reexec, int quiet)
write(outpipe[1],buf,bytesread);
}
while ((tmpstr=getLine(&buf))) {
- if (!reexec)
- logString(cmdname,tmpstr);
+ if (!reexec) {
+ if (getenv("IN_INITLOG")) {
+ char *buffer=calloc(2048,sizeof(char));
+ snprintf(buffer,2048,"-n %s -s \"%s\"",
+ cmdname,tmpstr);
+ write(CMD_FD,buffer,strlen(buffer));
+ free(buffer);
+ } else {
+ logString(cmdname,tmpstr);
+ }
+ }
else {
char **cmdargs=NULL;
char **tmpargs=NULL;