From 99b0192f39af7eb8d3a918bee813e5bfaf7bfaba Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Wed, 21 Jul 2010 23:34:32 +0200 Subject: [PATCH] rc: In 'syslogd', adjust the handling of syslog sockets in chroots. Use a keyword, 'chrootdir', to help syslogd place additional log sockets in chroots. It's main use at the moment is to help with BIND installed from pkgsrc. This silences the other of the rc error messages we've been having since we removed BIND from base. --- etc/rc.d/syslogd | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/etc/rc.d/syslogd b/etc/rc.d/syslogd index b571210fd9..17b3d75ec7 100644 --- a/etc/rc.d/syslogd +++ b/etc/rc.d/syslogd @@ -2,7 +2,6 @@ # # $NetBSD: syslogd,v 1.12 2002/03/22 04:34:00 thorpej Exp $ # $FreeBSD: src/etc/rc.d/syslogd,v 1.4 2002/10/01 13:29:44 ru Exp $ -# $DragonFly: src/etc/rc.d/syslogd,v 1.6 2005/11/19 21:47:32 swildner Exp $ # # PROVIDE: syslogd @@ -22,7 +21,6 @@ _sockfile="/var/run/syslogd.sockets" pidfile="/var/run/syslog.pid" evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\"" -altlog_proglist="named" syslogd_precmd() { @@ -37,14 +35,19 @@ syslogd_precmd() # ( umask 022 ; > $_sockfile ) - # If running named(8) chrooted, added appropriate + # Find /etc/rc.d scripts with "chrootdir" rcorder(8) keyword, + # and if $${app}_chrootdir is a directory, add appropriate # syslog socket to list of sockets to watch. # - for _l in $altlog_proglist; do + for _lr in $(rcorder -k chrootdir /etc/rc.d/*); do + ( + _l=${_lr##*/} + load_rc_config ${_l} eval _ldir=\$${_l}_chrootdir - if checkyesno `set_rcvar $_l` && [ -n "$_ldir" ]; then + if checkyesno $_l && [ -n "$_ldir" ]; then echo "${_ldir}/var/run/log" >> $_sockfile fi + ) done # If other sockets have been provided, change run_rc_command()'s -- 2.41.0