Date: Tue, 21 Jan 2003 11:50:01 -0800 (PST) From: k.j.koster@telecom.tno.nl To: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/47245: daemonctl scribbles over log file when single fi le is specified Message-ID: <200301211950.h0LJo1Zo001946@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/47245; it has been noted by GNATS. From: k.j.koster@telecom.tno.nl To: freebsd-gnats-submit@FreeBSD.org, naddy@mips.inka.de, znerd@freebsd.org Cc: Subject: Re: ports/47245: daemonctl scribbles over log file when single fi le is specified Date: Tue, 21 Jan 2003 20:39:57 +0100 Dear All, I tested the (new) fix below and it seems to work. This patch adds the O_APPEND flag to the open() call and removed the problematic lseek(). The code below runs on our nightly build server, so I'll see mangled entries soon enough if they return. In answer to Christian's question: I have found this in www/orion, but this affects all ports that use daemonctl.c from www/jakarta-tomcat4. A quick grep reveals them to be the following: java/jboss2 java/jboss3 www/orion www/orion-devel www/jakarta-tomcat3 www/jakarta-tomcat4 www/jakarta-tomcat41 --- daemonctl.c.orig Tue Jan 21 20:19:24 2003 +++ daemonctl.c Tue Jan 21 20:22:28 2003 @@ -385,24 +385,22 @@ } /* Open the stdout log file */ - stdoutLogFile = open("%%STDOUT_LOG%%", O_WRONLY); + stdoutLogFile = open("%%STDOUT_LOG%%", O_WRONLY | O_APPEND); if (stdoutLogFile < 0) { printf(" [ FAILED ]\n"); fprintf(stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to open %%STDOUT_LOG%% for writing: "); perror(NULL); exit(ERR_STDOUT_LOGFILE_OPEN); } - lseek(stdoutLogFile, (off_t) 0, SEEK_END); /* Open the stderr log file */ - stderrLogFile = open("%%STDERR_LOG%%", O_WRONLY); + stderrLogFile = open("%%STDERR_LOG%%", O_WRONLY | O_APPEND); if (stderrLogFile < 0) { printf(" [ FAILED ]\n"); fprintf(stderr, "%%CONTROL_SCRIPT_NAME%%: Unable to open %%STDERR_LOG%% for writing: "); perror(NULL); exit(ERR_STDERR_LOGFILE_OPEN); } - lseek(stderrLogFile, (off_t) 0, SEEK_END); /* Split this process in two */ pid = fork(); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200301211950.h0LJo1Zo001946>