Arthur Clement
2010-Jul-13 15:27 UTC
[Ovirt-devel] [PATCH node] Kill persistent dhclient on the temporary interface
Signed-off-by: Arthur Clement <aclement at linagora.com> --- scripts/ovirt-early | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/scripts/ovirt-early b/scripts/ovirt-early index 1c15792..6b510ca 100755 --- a/scripts/ovirt-early +++ b/scripts/ovirt-early @@ -43,6 +43,9 @@ configure_ovirt_management_nic() { log "Using interface $DEVICE" # setup temporary interface to retrieve configuration /sbin/dhclient $1 + # save dhclient PID for killing it later + dhclientPid=$( /sbin/pidof dhclient ) + fi if [ $? -eq 0 ]; then # from network-scripts/ifup-post @@ -97,7 +100,9 @@ configure_ovirt_management_nic() { log "Default config applied" fi - service network restart + service network stop + /bin/kill -9 $dhclientPid + service network start } -- 1.7.1
Alan Pevec
2010-Jul-13 15:55 UTC
[Ovirt-devel] [PATCH node] Kill persistent dhclient on the temporary interface
On Tue, Jul 13, 2010 at 5:27 PM, Arthur Clement <aclement at linagora.com> wrote:> > Signed-off-by: Arthur Clement <aclement at linagora.com> > --- > ?scripts/ovirt-early | ? ?7 ++++++- > ?1 files changed, 6 insertions(+), 1 deletions(-) > > diff --git a/scripts/ovirt-early b/scripts/ovirt-early > index 1c15792..6b510ca 100755 > --- a/scripts/ovirt-early > +++ b/scripts/ovirt-early > @@ -43,6 +43,9 @@ configure_ovirt_management_nic() { > ? ? ? ? ? ? log "Using interface $DEVICE" > ? ? ? ? ? ? # setup temporary interface to retrieve configuration > ? ? ? ? ? ? /sbin/dhclient $1nack, instead of saving PID and killing it, we could simply: - /sbin/dhclient $1 + /sbin/dhclient -1 $1 then there wouldn't be dhclient left running.> + ? ? ? ? ? # save dhclient PID for killing it later > + ? ? ? ? ? dhclientPid=$( /sbin/pidof dhclient ) > + > ? ? ? ? fi > ? ? ? ? if [ $? -eq 0 ]; then > ? ? ? ? ? ? # from network-scripts/ifup-post > @@ -97,7 +100,9 @@ configure_ovirt_management_nic() { > ? ? ? ? log "Default config applied" > ? ? fi > > - ? ?service network restart > + ? ?service network stop > + ? ?/bin/kill -9 $dhclientPid > + ? ?service network start > > ?}