Subject: misc/26478: /etc/rc.d/syslogd fails to add sockets of chrooted apps
To: None <>
From: None <>
List: netbsd-bugs
Date: 07/30/2004 11:16:11
>Number:         26478
>Category:       misc
>Synopsis:       /etc/rc.d/syslogd fails to add sockets of chrooted apps
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    misc-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jul 30 09:17:00 UTC 2004
>Originator:     Jukka Salmi
>Release:        NetBSD 2.0G, NetBSD 1.6.2_STABLE
System: NetBSD 2.0G NetBSD 2.0G (GENERIC) #0: Fri Jul 23 18:39:25 CEST 2004 i386
Architecture: i386
Machine: i386
If an application sets ${name}_chrootdir in /etc/rc.conf.d/${name}, the
syslogd rc.d script fails to add the applications log socket name to
/var/run/syslogd.sockets. Setting ${name}_chrootdir in /etc/rc.conf
instead works fine.
That's because the syslogd rc.d script doesn't know about the
${name}_chrootdir setting if that's defined in a file which wasn't
- set $name=YES for an application which uses the chrootdir KEYWORD
- set ${name}_chrootdir=/path/to/chroot in /etc/rc.conf.d/${name}
- restart syslogd using /etc/rc.d/syslogd
- /var/run/syslogd.sockets does _not_ contain /path/to/chroot/var/run/log
- add ${name}_chrootdir=/path/to/chroot to /etc/rc.d
- restart syslogd using /etc/rc.d/syslogd
- /var/run/syslogd.sockets _does_ contain /path/to/chroot/var/run/log
Probably something like

--- syslogd.orig        Fri Jul 30 10:41:19 2004
+++ syslogd     Fri Jul 30 10:42:06 2004
@@ -37,6 +37,7 @@
        for _lr in $(rcorder -k chrootdir /etc/rc.d/*); do
+               load_rc_config $_l
                eval _ldir=\$${_l}_chrootdir
                if checkyesno $_l && [ -n "$_ldir" ]; then
                        echo "${_ldir}/var/run/log" >> $_sockfile