From owner-freebsd-questions@FreeBSD.ORG Wed May 3 20:42:03 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2D28E16A460 for ; Wed, 3 May 2006 20:42:03 +0000 (UTC) (envelope-from danielby@slightlystrange.org) Received: from catflap.slightlystrange.org (cpc6-cmbg1-0-0-cust82.cmbg.cable.ntl.com [82.10.236.83]) by mx1.FreeBSD.org (Postfix) with ESMTP id 34D4943D45 for ; Wed, 3 May 2006 20:42:01 +0000 (GMT) (envelope-from danielby@slightlystrange.org) Received: from danielby by catflap.slightlystrange.org with local (Exim 4.61 #1) id 1FbOAZ-000NpI-JV by authid ; Wed, 03 May 2006 21:41:59 +0100 Date: Wed, 3 May 2006 21:41:59 +0100 From: Daniel Bye To: Daniel Bye , freebsd-questions@freebsd.org Message-ID: <20060503204159.GB79222@catflap.slightlystrange.org> Mail-Followup-To: Daniel Bye , freebsd-questions@freebsd.org References: <20060503183528.GA79222@catflap.slightlystrange.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Yylu36WmvOXNoKYn" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.1i X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: danielby@slightlystrange.org X-SA-Exim-Scanned: No (on catflap.slightlystrange.org); SAEximRunCond expanded to false Cc: Subject: Re: dhclient-exit-hooks X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Daniel Bye List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 May 2006 20:42:03 -0000 --Yylu36WmvOXNoKYn Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 03, 2006 at 03:35:13PM -0400, fbsd wrote: > I do not see why postfix would have any thing to do with logger not > working. ACK. I've been talking about the "Shared object not found" error, which is definitely, from the error message you posted, caused by postfix not being able to find pcre. Has that problem gone away with the addition of the rcorder directives? (I've made the assumption here that your script is being called by rc, from one of your rc.d directories - if this is NOT the case, then you can pretty well ignore all I've said, and I apologise for being off the mark...) > I added some ehco statments to test if the "if" statment is working. > In this pass /etc/dhcpd.name-servers.tmp =3D /etc/dhcpd.name-servers > so the second echo should not have been executed, but it was Have you run the script with xtrace turned on? That at least will show you which lines of the script are being run. It might help you narrow down on the part that goes wrong. I really can't see anything wrong with the logic or syntax of your script, so this part of it is somewhat baffling to me. > >From testing it looks like only the dhcpc variables plus mv, > and echo commands work in the script. >=20 > from the boot log > dc0: link state changed to DOWN > dc0: no link ....dc0: link state changed to UP > got link > dc0: link state changed to DOWN > before if check > after if check > DHCPREQUEST on dc0 to 255.255.255.255 port 67 > dc0: link state changed to UP > DHCPACK from 10.0.10.2 > dc0: link state changed to DOWN > bound to 10.0.10.4 -- renewal in 43200 seconds. >=20 >=20 > and here is the dhclient-exit-hooks script >=20 > #!/bin/sh >=20 > # PROVIDE: dhclient-exit-hooks > # REQUIRE: SERVERS >=20 > ############### Start of refresh dhcpd dns ip #################### > # This script will propagate to dhcpd the changed dns servers ip > address > # which dhcp-client puts in resolv.conf. > # > # In dhcpd.conf replace the "option domain-name-servers" line with > this > # > # include "/etc/dhcpd.name-servers"; > # > # Spript uses the dhcpc variables to build temp line in dhcpd > format. > # Then compare temp content to production content. > # If different replace production content with new content from > temp, > # and restart dhcp to reread dhcpd.conf containing new ISP dns ip > addresses. > # > # logging event and sending email to user root is optional. > # > # Note: All LAN machines using dhcpd will not get new ISP dns ip > addresses > # until they reboot or their lease comes up for renewal. > # > # Each of the following lines must be one long line. IE: no wrap > arounds > #################################################################### > #### >=20 > # load my_domain_name_servers variable with ISP dns ip addresses > from dhcpc > my_domain_name_servers=3D`echo $new_domain_name_servers | sed -e 's/ > /, /g'` >=20 > # Create single line in file to be included in dhcpd.conf > echo "option domain-name-servers $my_domain_name_servers ;" > > /etc/dhcpd.name-servers.tmp >=20 > echo " before if check" >=20 > # See if different from what production file contains > cmp -s /etc/dhcpd.name-servers.tmp /etc/dhcpd.name-servers > if [ $? -gt 0 ]; then > echo " after if check" > # move the new file into place > mv /etc/dhcpd.name-servers.tmp /etc/dhcpd.name-servers > # restart dhcp using whatever is appropriate for your platform > #service dhcpd restart > #/usr/local/etc/rc.d/isc-dhcpd.sh restart -q > # Write message to /var/log/dhcpc.log to document event. > /usr/bin/logger -p user.warning -t dhclient Your ISP DNS IP > addresses changed. > # Write message to /var/log/dhcpd.log to document event. > /usr/bin/logger -p local1.warning -t dhclient Your ISP DNS IP > addresses changed. > fi > #rm -f /etc/dhcpd.name-servers.tmp > ############### End of refresh dhcpd dns ip script > ################### [---snip---] > > > using sendmail to construct the email made no difference. > > > Still get this message > > > > > > /libexec/ld-elf.so.1: Shared object "libpcre.so.0" not found, > > > required by "send-mail" Has this gone away? --^ Apologies for the crossed wires. Dan --=20 Daniel Bye PGP Key: ftp://ftp.slightlystrange.org/pgpkey/dan.asc PGP Key fingerprint: D349 B109 0EB8 2554 4D75 B79A 8B17 F97C 1622 166A _ ASCII ribbon campaign ( ) - against HTML, vCards and X - proprietary attachments in e-mail / \ --Yylu36WmvOXNoKYn Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFEWRWXixf5fBYiFmoRAqpzAKDY5P3JrM9W6avDrRu+0Xl8zsGMdACgrJQd UUkftXqPFPF7pkVcB0iAfoY= =wIZl -----END PGP SIGNATURE----- --Yylu36WmvOXNoKYn--