Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 3 May 2006 21:41:59 +0100
From:      Daniel Bye <dan@slightlystrange.org>
To:        Daniel Bye <freebsd-questions@slightlystrange.org>, freebsd-questions@freebsd.org
Subject:   Re: dhclient-exit-hooks
Message-ID:  <20060503204159.GB79222@catflap.slightlystrange.org>
In-Reply-To: <MIEPLLIBMLEEABPDBIEGGEBJHGAA.fbsd@a1poweruser.com>
References:  <20060503183528.GA79222@catflap.slightlystrange.org> <MIEPLLIBMLEEABPDBIEGGEBJHGAA.fbsd@a1poweruser.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060503204159.GB79222>