From owner-freebsd-current@FreeBSD.ORG Wed Jun 8 17:39:16 2005 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C448716A41C for ; Wed, 8 Jun 2005 17:39:16 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 70FD843D49 for ; Wed, 8 Jun 2005 17:39:16 +0000 (GMT) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.13.0/8.13.0) with ESMTP id j58HdEKG022520; Wed, 8 Jun 2005 10:39:14 -0700 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.13.0/8.13.0/Submit) id j58HdDhv022519; Wed, 8 Jun 2005 10:39:13 -0700 Date: Wed, 8 Jun 2005 10:39:13 -0700 From: Brooks Davis To: Max Boyarov Message-ID: <20050608173913.GB20036@odin.ac.hmc.edu> References: <86vf4pq931.fsf@tut.by> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1UWUbFP1cBYEclgG" Content-Disposition: inline In-Reply-To: <86vf4pq931.fsf@tut.by> User-Agent: Mutt/1.4.1i X-Virus-Scanned: by amavisd-new X-Spam-Status: No, hits=0.0 required=8.0 tests=none autolearn=no version=2.63 X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on odin.ac.hmc.edu Cc: freebsd-current@freebsd.org Subject: Re: dhclient-exit-hooks X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2005 17:39:16 -0000 --1UWUbFP1cBYEclgG Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 08, 2005 at 04:20:02PM +0300, Max Boyarov wrote: >=20 > After last upgrade to current my dhclient-exit-hooks don't work. > I checked my configuration again, but I cant found any place in > /sbin/dhclient-script that runs hooks. How can I now use > dhclient-exit-hooks ? We need to add support for exit hooks back to the script.a I think this should do it: Index: sbin/dhclient/dhclient-script =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/src/sbin/dhclient/dhclient-script,v retrieving revision 1.2 diff -u -p -r1.2 dhclient-script --- sbin/dhclient/dhclient-script 7 Jun 2005 04:32:29 -0000 1.2 +++ sbin/dhclient/dhclient-script 8 Jun 2005 17:34:34 -0000 @@ -172,6 +172,16 @@ add_new_resolv_conf() { return 1 } =20 +# Must be used on exit. Invokes the local dhcp client exit hooks, if any. +exit_with_hooks() { + exit_status=3D$1 + if [ -f /etc/dhclient-exit-hooks ]; then + . /etc/dhclient-exit-hooks + fi + # probably should do something with exit status of the local script + exit $exit_status +} + # # Start of active code. # @@ -247,14 +257,14 @@ TIMEOUT) fi add_new_routes if add_new_resolv_conf; then - exit 0 + exit_with_hooks 0 fi fi fi ifconfig $interface inet -alias $new_ip_address $medium delete_old_routes - exit 1 + exit_with_hooks 1 ;; esac =20 -exit 0 +exit_with_hooks 0 -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 --1UWUbFP1cBYEclgG Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQFCpy0/XY6L6fI4GtQRAtYcAKDYTd2S1hTSR4jowJZHnQxcy6F7lQCfQEJQ 6Yc7gEb6DjbtltN0APNfnxg= =D7ep -----END PGP SIGNATURE----- --1UWUbFP1cBYEclgG--