From: Derrick Brashear Date: Thu, 14 Apr 2005 05:42:59 +0000 (+0000) Subject: STABLE14-support-named-pipe-logs-20050414 X-Git-Tag: openafs-devel-1_3_82~63 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=461e56a6b54eafd9a97cd77bc7f1195815883749;p=packages%2Fo%2Fopenafs.git STABLE14-support-named-pipe-logs-20050414 so log files can be named pipes (cherry picked from commit bdc7e43117706d0aa46d3b6435489e9d4c2b0888) --- diff --git a/src/bozo/bosserver.c b/src/bozo/bosserver.c index e08881050..c5bbf8b11 100644 --- a/src/bozo/bosserver.c +++ b/src/bozo/bosserver.c @@ -718,6 +718,7 @@ main(int argc, char **argv, char **envp) char namebuf[AFSDIR_PATH_MAX]; #ifndef AFS_NT40_ENV int nofork = 0; + struct stat sb; #endif #ifdef AFS_AIX32_ENV struct sigaction nsa; @@ -863,7 +864,12 @@ main(int argc, char **argv, char **envp) background(); #endif /* ! AFS_NT40_ENV */ - if (!DoSyslog) { + if ((!DoSyslog) +#ifndef AFS_NT40_ENV + && (!(fstat(AFSDIR_BOZLOG_FILE, &sb) == 0) && + (S_ISFIFO(sb.st_mode))) +#endif + ) { strcpy(namebuf, AFSDIR_BOZLOG_FILE); strcat(namebuf, ".old"); renamefile(AFSDIR_BOZLOG_FILE, namebuf); /* try rename first */ diff --git a/src/util/serverLog.c b/src/util/serverLog.c index e0e97d61f..edf938632 100644 --- a/src/util/serverLog.c +++ b/src/util/serverLog.c @@ -44,6 +44,7 @@ RCSID #include #endif #endif +#include #include "afsutil.h" #include "fileutil.h" #if defined(AFS_PTHREAD_ENV) @@ -228,10 +229,16 @@ OpenLog(const char *fileName) char FileName[MAXPATHLEN]; #ifndef AFS_NT40_ENV + struct stat statbuf; + if (serverLogSyslog) { openlog(serverLogSyslogTag, LOG_PID, serverLogSyslogFacility); return (0); } + + /* Support named pipes as logs by not rotating them */ + if ((fstat(fileName, &statbuf) == 0) && (S_ISFIFO(statbuf.st_mode))) + return (0); #endif if (mrafsStyleLogs) {