<div dir="ltr">Package: isc-dhcp-client<div style>Severity: wishlist</div><div style><br></div><div style><div>Please add a hook script /usr/lib/resolvconf/dpkg-event.d/isc-dhcp-client.</div><div><br></div><div>The purpose this script is to cause isc-dhcp-client to take notice of</div>
<div>the installation or removal of the resolvconf package. If resolvconf</div><div>has just been installed while dhclient instances are running, for</div><div>example, then each dhclient instance should register any</div>
<div>nameserver addresses already acquired via DHCP with resolvconf.</div><div><br></div><div>The dhclient-enter-hooks.d/resolvconf hook script already does the</div><div>right thing if dhclient is started when resolvconf was already installed.</div>
<div>This script also illustrates what needs to be done when resolvconf is</div><div>installed while dhclient is running.</div><div><br></div><div>See below for an excerpt from resolvconf's README file giving</div><div>
general information about resolvconf packaging-event hook scripts.</div><div>Please see the README file itself for much more background</div><div>information.</div><div><br></div><div>=== Excerpt from resolvconf README file ===</div>
<div>Any package, foo, that supports supplying information to resolvconf should</div><div>include a hook script /usr/lib/resolvconf/dpkg-event.d/foo which, when</div><div>called</div><div>with the argument "install", takes whatever actions are necessary to cause</div>
<div>the</div><div>program(s) in foo to supply their nameserver information to resolvconf; and</div><div>when called with the argument "remove" takes whatever actions are</div><div>appropriate</div><div>given that the resolvconf package has been removed (and, in being removed,</div>
<div>may</div><div>have removed foo's nameserver information).</div><div><br></div><div>The hook script thus has the following form.</div><div><br></div><div> #!/bin/sh</div><div> #</div><div> # /usr/lib/resolvconf/dpkg-event.d/foo</div>
<div> #</div><div> # The resolvconf dpkg-event hook script for the foo package</div><div> #</div><div> if foo_is_running ; then</div><div> if [ "$1" = "install" ] ; then</div><div> foo-ctrl send-nameserver-info-to-resolvconf</div>
<div> elif [ "$1" = "remove" ] ; then</div><div> ...</div><div> fi</div><div> fi</div><div><br></div><div>If foo is controlled by an initscript whose methods take appropriate actions</div>
<div>conditional upon resolvconf's presence then something like the following</div><div>might</div><div>be appropriate.</div><div><br></div><div> force_reload_foo() {</div><div> if which invoke-rc.d >/dev/null 2>&1 ; then</div>
<div> invoke-rc.d foo force-reload</div><div> elif [ -x /etc/init.d/foo ] ; then</div><div> /etc/init.d/foo force-reload</div><div> fi</div><div> }</div><div> case "$1" in</div>
<div> install|remove) force_reload_foo ;;</div><div> esac</div><div><br></div><div>The hook script is called (with argument "install") from resolvconf's</div><div>postinst</div><div>"configure" method and (with "remove") from resolvconf's postrm "remove"</div>
<div>method.</div><div><br></div><div>Foo's hook script is called with argument "install" if and only if foo is</div><div>fully installed both when resolvconf's preinst install runs and when its</div><div>
postinst configure runs. The hook script is called with argument "remove"</div><div>if</div><div>and only if foo is fully installed when resolvconf's postrm remove runs.</div><div><br></div><div>The hook script must be owned by root and have its execute permission bit</div>
<div>set</div><div>and must have the same name as the package that owns it.</div><div><br></div><div>Arguments other than "install" and "remove" are reserved for future use and</div><div>must be silently ignored.</div>
<div><br></div></div></div>