Subject: Re: Stopping dhclient does not restore /etc/resolv.conf
To: Luke Mewburn <lukem@NetBSD.org>
From: None <sutre@labri.fr>
List: netbsd-help
Date: 11/03/2003 01:33:33
Selon Luke Mewburn <lukem@NetBSD.org>:

> On Wed, Oct 29, 2003 at 12:32:32AM +0100, Gregoire Sutre wrote:
>   | So I intend to add the following line in /etc/rc.d/dhclient:
>   |=20
>   | stop_cmd=3D"$command -r"
>   |
>   | where $command is previously set to /sbin/dhclient (in
>   | /etc/rc.d/dhclient).
>   |
>   | As I'm new to NetBSD, I would appreciate if an experienced user
>   | could confirm that I won't introduce problems with this "fix".
>=20
> That should work; you won't have a "nice" check if dhclient is running
> and "forcestop" may not function the same way, but in general these
> shouldn't be large problems.

Thanks for your reply :-)

I would rather keep the nice checks of the default stop behavior (from
rc.subr)...

So I tried stop_precmd=3D"$command -r" instead of stop_cmd=3D"$command -r=
", but
it does not work very well, as dhclient -r already stops dhclient (and I
guess a stop precommand should not stop the service by itself).

I would like to keep the checks of the default stop command, then try
dhclient -r, and if that did not stop dhclient then kill it, and finally
go on with the default stop behavior (wait_for_pids).

Do I have a better option than writing the whole thing (with inspiration
from rc.subr)?

> I suggest actually making that change in /etc/rc.conf.d/dhclient,
> so /etc/rc.d/dhclient can be upgraded by an operating system upgrade
> and you won't lose your functionality change.

Thanks, I didn't know about /etc/rc.conf.d/, it's nice :-)

Gregoire.


-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/