Subject: Re: Strange problem with syslogd on NetBSD-release-1-5
To: NetBSD User's Discussion List <netbsd-users@netbsd.org>
From: Andrew Brown <atatat@atatdot.net>
List: netbsd-users
Date: 07/11/2001 11:35:06
>> Restarting syslogd makes everything work fine again, until the next time
>> it happens.
>
>Note that restarting syslogd might make it work fine again, but many
>daemons will now have a disconnected logging socket and will never
>syslog again. See PR#8065 and PR#11087.
what if vsyslog() in lib/libc/gen/syslog.c was changed like this:
if (send(LogFile, tbuf, cnt, 0) >= 0) {
mutex_unlock(&syslog_mutex);
return;
}
+ if (errno == EBADF) {
+ closelog_unlocked();
+ openlog_unlocked(LogTag, LogStat | LOG_NDELAY, 0);
+ if (send(LogFile, tbuf, cnt, 0) >= 0) {
+ mutex_unlock(&syslog_mutex);
+ return;
+ }
+ }
mutex_unlock(&syslog_mutex);
would that be good?
--
|-----< "CODE WARRIOR" >-----|
codewarrior@daemon.org * "ah! i see you have the internet
twofsonet@graffiti.com (Andrew Brown) that goes *ping*!"
andrew@crossbar.com * "information is power -- share the wealth."