[comp.bugs.4bsd] syslogd stops working

schaefer@bgsuvax.UUCP (05/14/87)

Index:	etc/syslogd.c

Repeat By:

Send dozens of HUP signals to the syslogd process.  It will eventually
cease functioning.  If the syslogd process has been getting daily HUP
signals as usual, and your machine has been up for ~60 days, you get
the same effect.  (Wouldn't you love that problem? :-))

Description:

In routine init(), all log files are supposed to closed, and then
reopened according to the /etc/syslog.conf file.  Files of type F_FILE
and F_TTY are correctly closed, but files of type F_CONSOLE are
missed.  Each invocation of init adds as many perpetually open
F_CONSOLE log files as you mention in your /etc/syslog.conf.

Fix:

Close log files of type F_CONSOLE at the appropriate point.

RCS file: RCS/syslogd.c,v
retrieving revision 1.1
diff -c -r1.1 syslogd.c
*** /tmp/,RCSt1002312	Thu May 14 10:27:26 1987
--- syslogd.c	Thu May 14 10:18:03 1987
***************
*** 797,803
  	 *  Close all open log files.
  	 */
  	for (f = Files; f < &Files[NLOGS]; f++) {
! 		if (f->f_type == F_FILE || f->f_type == F_TTY)
  			(void) close(f->f_file);
  		f->f_type = F_UNUSED;
  	}

--- 797,805 -----
  	 *  Close all open log files.
  	 */
  	for (f = Files; f < &Files[NLOGS]; f++) {
! 		if (f->f_type == F_FILE ||
! 		    f->f_type == F_TTY ||
! 		    f->f_type == F_CONSOLE)
  			(void) close(f->f_file);
  		f->f_type = F_UNUSED;
  	}
-- 
	Stephen P. Schaefer
	Systems Programmer
	schaefer@research1.bgsu.edu
	...!cbatt!osu-eddie!bgsuvax!schaefer