dhclient-exit-hooks
fbsd
fbsd at a1poweruser.com
Wed May 3 19:35:16 UTC 2006
I do not see why postfix would have any thing to do with logger not
working.
I added some ehco statments to test if the "if" statment is working.
In this pass /etc/dhcpd.name-servers.tmp = /etc/dhcpd.name-servers
so the second echo should not have been executed, but it was
>From testing it looks like only the dhcpc variables plus mv,
and echo commands work in the script.
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.
and here is the dhclient-exit-hooks script
#!/bin/sh
# PROVIDE: dhclient-exit-hooks
# REQUIRE: SERVERS
############### 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
####################################################################
####
# load my_domain_name_servers variable with ISP dns ip addresses
from dhcpc
my_domain_name_servers=`echo $new_domain_name_servers | sed -e 's/
/, /g'`
# 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
echo " before if check"
# 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
###################
-----Original Message-----
From: owner-freebsd-questions at freebsd.org
[mailto:owner-freebsd-questions at freebsd.org]On Behalf Of Daniel Bye
Sent: Wednesday, May 03, 2006 2:35 PM
To: freebsd-questions at freebsd.org
Subject: Re: dhclient-exit-hooks
On Wed, May 03, 2006 at 02:25:08PM -0400, fbsd wrote:
> There is nothing to rebuild.
> I am using the built in dhclient that comes with the system.
But it's not dhclient that's emitting the error, is it? It's your
MTA.
(check in /etc/mail/mailer.conf, and you will see that send-mail is
an alias for the binary of your MTA)
Atom's suggestion is worth pursuing.
Dan
>
> -----Original Message-----
> From: Atom Powers [mailto:atom.powers at gmail.com]
> Sent: Wednesday, May 03, 2006 1:05 PM
> To: fbsd at a1poweruser.com
> Cc: Norbert Papke; freebsd-questions at freebsd.org
> Subject: Re: dhclient-exit-hooks
>
>
> On 5/3/06, fbsd <fbsd at a1poweruser.com> wrote:
> > I changed #! /bin/sh to #!/bin/sh it had no effect.
> > Logger command still not producing output.
> >
> > 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"
> >
>
> Did you rebuild the package?
> I have had a similar problem with, in my case, net-snmp.
> Reinstalling
> the port fixed it.
> Something about statically linked libraries I think.
>
>
> --
> --
> Perfection is just a word I use occasionally with mustard.
> --Atom Powers--
>
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to
"freebsd-questions-unsubscribe at freebsd.org"
>
--
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
/ \
More information about the freebsd-questions
mailing list