From owner-freebsd-stable@FreeBSD.ORG Sun Jul 11 19:46:06 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 60FCF1065676 for ; Sun, 11 Jul 2010 19:46:06 +0000 (UTC) (envelope-from h.schmalzbauer@omnilan.de) Received: from stith.flb.omnilan.net (stith.flb.omnilan.net [62.245.232.135]) by mx1.freebsd.org (Postfix) with ESMTP id D6B518FC19 for ; Sun, 11 Jul 2010 19:46:05 +0000 (UTC) Received: from titan.lan.flb.omnilan.net (titan.lan.flb.omnilan.net [172.21.1.150]) (authenticated bits=0) by stith.flb.omnilan.net (8.13.8/8.13.8) with ESMTP id o6BJk5mk076003 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 11 Jul 2010 21:46:05 +0200 (CEST) (envelope-from h.schmalzbauer@omnilan.de) Message-ID: <4C3A1F72.2040303@omnilan.de> Date: Sun, 11 Jul 2010 21:45:54 +0200 From: Harald Schmalzbauer Organization: OmniLAN User-Agent: Thunderbird 2.0.0.23 (X11/20090906) MIME-Version: 1.0 To: FreeBSD Stable , wxs@freebsd.org, mtm@freebsd.org X-Enigmail-Version: 0.95.6 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigB2ED1EE57AEA2B702AC55986" Cc: Subject: syslogs altlog_proglist and isc-dhcpd logging for FreeBSD X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 11 Jul 2010 19:46:06 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB2ED1EE57AEA2B702AC55986 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: quoted-printable Hello, since isc-dhcpd-4.1.1 promised ipv6, I wanted to replace my existing=20 DHCP servers with this new version. I'm running chrooted. My problem was with logging. dhcpd is very noisy and setting "log-facility local1" in dhcpd.conf=20 doesn't work out of the box (*) because of the chrooted environment. But some good guys already coded everything which is needed to have=20 dhcpd logging with chrooted. - syslogd has the -l switch which enables to place an additional log=20 socket into the chrooted enivronment. - /etc/rc.d/syslogd already knows about this and has the variable=20 altlog_proglist, which checks for possible chrooted daemons The problems are: - /etc/rc.d/syslogd has the altlog_proglist hard coded - /etc/rc.d/syslogd checks for daemons in rc.conf which have flags=20 any_chrootdir, but rc.d/isc-dhcpd uses dhcpd_rootdir. So here's the view simple lines that make dhcpd logging working with=20 individula log-facility configs: --- etc/rc.d/syslogd 2009-09-06 02:47:31.000000000 +0200 +++ etc/rc.d/syslogd 2010-07-11 21:27:46.477366986 +0200 @@ -1,6 +1,6 @@ #!/bin/sh # -# $FreeBSD: src/etc/rc.d/syslogd,v 1.13.2.1 2009/08/03 08:13:06=20 kensmith Exp $ +# $FreeBSD: src/etc/rc.d/syslogd,v 1.13.2.1.4.1 2010/06/14 02:09:06=20 kensmith Exp $ # # PROVIDE: syslogd @@ -19,7 +19,9 @@ sockfile=3D"/var/run/syslogd.sockets" evalargs=3D"rc_flags=3D\"\`set_socketlist\` \$rc_flags\"" -altlog_proglist=3D"named" + +load_rc_config $name +altlog_proglist=3D${syslogd_altlog_proglist:-"named"} syslogd_precmd() { --- etc/defaults/rc.conf 2009-11-01 15:08:40.000000000 +0100 +++ etc/defaults/rc.conf 2010-07-11 21:30:04.373974162 +0200 @@ -255,6 +255,7 @@ syslogd_enable=3D"YES" # Run syslog daemon (or NO). syslogd_program=3D"/usr/sbin/syslogd" # path to syslogd, if you want a = different one. syslogd_flags=3D"-s" # Flags to syslogd (if enabled). +syslogd_altlog_proglist=3D"named" # Check vor chrooted daemons and place= =20 additional socket inetd_enable=3D"NO" # Run the network daemon dispatcher (YES/NO). inetd_program=3D"/usr/sbin/inetd" # path to inetd, if you want a=20 different one. inetd_flags=3D"-wW -C 60" # Optional flags to inetd --- etc/rc.d/isc-dhcpd.orig 2010-07-08 13:03:45.000000000 +0200 +++ etc/rc.d/isc-dhcpd 2010-07-11 20:41:36.000000000 +0200 @@ -32,7 +32,7 @@ dhcpd_chroot_enable=3D${dhcpd_chroot_enable:-"NO"} # runs chrooted? dhcpd_devfs_enable=3D${dhcpd_devfs_enable:-"YES"} # devfs if available= ? -dhcpd_rootdir=3D${dhcpd_rootdir:-/var/db/${name}} # directory to run in= +dhcpd_rootdir=3D${dhcpd_chrootdir:-/var/db/${name}} # directory to run = in # dhcpd_includedir=3D"" # directory for included config files safe_run () # rc command [args...] Is it possible to get these changes into base system? @wxs Any objections changing dhacpd_rootdir into dhcpd_chrootdir variable= ? Shall I file a PR? Thanks, -Harry P.S.: For the records, here another possibility to make dhcpd use=20 different syslog facility in chrooted environmen: (*) Chaging the syslog facility of dhcpd with "log-facility local7;" in=20 dhcpd.conf doesn't work for chrooted dhcpd. At startup, it uses the local datagram syslogd socket /dev/log=20 (/var/run/syslog.sockets). The syslog facility change is done after changeroot took place, so in=20 the chrooted environment there is no syslogd reachable. To change the default syslog facility from LOG_DAEMON to LOG_LOCAL7 add=20 the following to the ports Makefile: CONFIGURE_ENV=3D CPPFLAGS=3D"-DDHCPD_LOG_FACILITY=3DLOG_LOCAL7 ...... *s= nip* --------------enigB2ED1EE57AEA2B702AC55986 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.13 (FreeBSD) iEYEARECAAYFAkw6H3sACgkQLDqVQ9VXb8iubwCeIiq+oH7zVIoVXWKVfCDgNOpo l2oAn2NTWQplEjHBTT9JFmoW6l94Ef4E =OWsE -----END PGP SIGNATURE----- --------------enigB2ED1EE57AEA2B702AC55986--