From owner-cvs-usrsbin Fri Jan 3 06:59:05 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.4/8.8.4) id GAA25280 for cvs-usrsbin-outgoing; Fri, 3 Jan 1997 06:59:05 -0800 (PST) Received: from pillar.elsevier.co.uk (root@pillar.elsevier.co.uk [193.131.222.35]) by freefall.freebsd.org (8.8.4/8.8.4) with ESMTP id GAA25217; Fri, 3 Jan 1997 06:57:22 -0800 (PST) Received: from snowdon.elsevier.co.uk (snowdon.elsevier.co.uk [193.131.197.164]) by pillar.elsevier.co.uk (8.8.3/8.8.3) with ESMTP id OAA23747; Fri, 3 Jan 1997 14:56:20 GMT Received: from cadair.elsevier.co.uk by snowdon.elsevier.co.uk with SMTP (PP); Fri, 3 Jan 1997 14:56:42 +0000 Received: from tees.elsevier.co.uk (tees.elsevier.co.uk [193.131.197.60]) by cadair.elsevier.co.uk (8.8.3/8.8.3) with ESMTP id OAA13430; Fri, 3 Jan 1997 14:56:36 GMT Received: (from dpr@localhost) by tees.elsevier.co.uk (8.8.3/8.8.3) id OAA01904; Fri, 3 Jan 1997 14:55:10 GMT To: "Jordan K. Hubbard" Cc: CVS-committers@freefall.freebsd.org, cvs-all@freefall.freebsd.org, cvs-usrsbin@freefall.freebsd.org Subject: Re: cvs commit: src/usr.sbin/syslogd syslogd.c References: <199701030713.XAA04264@freefall.freebsd.org> From: Paul Richards Date: 03 Jan 1997 14:55:09 +0000 In-Reply-To: "Jordan K. Hubbard"'s message of Thu, 2 Jan 1997 23:13:24 -0800 (PST) Message-ID: <57iv5est9u.fsf@tees.elsevier.co.uk> Lines: 37 X-Mailer: Gnus v5.3/Emacs 19.30 Sender: owner-cvs-usrsbin@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk "Jordan K. Hubbard" writes: > Modified: usr.sbin/syslogd syslogd.c > Log: > Unlink LogName before attempting to open it. Since we now have a lovely > bug in syslogd which causes it to die after random amounts of time (widely > reported), this at least allows the administrator to easily restart it > without wondering why it simply exits again each time. Ahhhhhhhh!! This is the very line that I removed in rev 1.6 !! LogName can be set from the command line, doing an unconditional link can be *VERY* dangerous if you happen to mis-type it. If syslogd fails to create the socket for some reason it's much better for the admin to see that than too let syslogd think it knows what it's doing and simply unlink LogName. Why is syslogd simply exiting and why would the unlink() fix this? It should print an error message if it fails to open the socket so the administrator should now why it's not restarting up. Another point is that the conditional unlink() in the die() function should clean up the socket under most terminal circumstances, if syslogd is exiting without doing so then it'd be nice to work out how since that's where the real bug is. These signals should all unlink LogName when syslogd dies. (void)signal(SIGTERM, die); (void)signal(SIGINT, Debug ? die : SIG_IGN); (void)signal(SIGQUIT, Debug ? die : SIG_IGN); -- Paul Richards. Originative Solutions Ltd. (Netcraft Ltd. contractor) Elsevier Science TIS online journal project. Email: p.richards@elsevier.co.uk Phone: 0370 462071 (Mobile), +44 (0)1865 843155