Subject: misc/6115: annoying but small misfeature in /etc/rc, fix included
To: None <gnats-bugs@gnats.netbsd.org>
From: Alexis Rosen <alexis@panix.com>
List: netbsd-bugs
Date: 09/07/1998 04:46:37
>Number: 6115
>Category: misc
>Synopsis: /etc/rc doesn't understand alternate locations for /dev/log
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: misc-bug-people (Misc Bug People)
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon Sep 7 01:50:01 1998
>Last-Modified:
>Originator: Alexis Rosen
>Organization:
Panix (Public Access Networks Corp.)
>Release: 1.3.2 (also current)
>Environment:
Not relevant
System: NetBSD panix7.panix.com 1.3.2 NetBSD 1.3.2 (PANIX-USER) #0: Thu Aug 13 15:03:31 EDT 1998 marcotte@juggler.panix.com:/devel/netbsd/1.3.2/src/sys/arch/i386/compile/PANIX-USER i386
>Description:
syslogd has a very nice feature: You can tell it to use a file other
than /dev/log for its AF_UNIX socket. This is useful if, for example,
you want that socket to be acessible inside a chroot environment.
But if you do this, you also want non-chroot things to be able to
talk to it. The natural way to do this is make /dev/log a symlink
to the real socket location.
The problem is that /etc/rc always executes "rm -f /dev/log". This
loses badly- the symlink is killed and everything expecting the log
device in the normal place is out of luck.
There's also a less important problem- the real log device file
doesn't get removed before syslogd starts, when you boot.
>How-To-Repeat:
Boot the machine...
>Fix:
Simple. Add the following line anywhere in /etc/rc.conf:
real_dev_log="" # specify path if not /dev/log
And change /etc/rc (unidiff):
--- 00-base/netbsd-1.3.2/etc/rc Fri May 22 11:52:16 1998
+++ 10-panix/netbsd/etc/rc Mon Sep 7 03:38:21 1998
@@ -142,5 +142,5 @@
if checkyesno syslogd; then
echo 'starting system logger'
- rm -f /dev/log
+ rm -f ${real_dev_log:-/dev/log}
syslogd $syslogd_flags
fi
--------------------------------------------------------
/a
---
Alexis Rosen Owner/Sysadmin,
PANIX Public Access Unix & Internet, NYC.
alexis@panix.com
>Audit-Trail:
>Unformatted: