I would like to track the "don't release the lease" issue here, so
for ease of reference I copy the relevant information over from
#196865, which is marked fixed and will be closed sooner or later.
// Thomas
-------------------------------------------------------------------
Message received at 196865@bugs.debian.org:
Received: (at 196865) by bugs.debian.org; 23 Apr 2004 01:34:02 +0000
Return-path: <ron@rjmx.net>
Received: from sccrmhc13.comcast.net [204.127.202.64]
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1BGpZq-0004TQ-00; Thu, 22 Apr 2004 18:34:02 -0700
Received: from mail.rjmx.net (rjmx.net[24.218.135.94])
by comcast.net (sccrmhc13) with ESMTP
id <2004042301333101600cqnhde>; Fri, 23 Apr 2004 01:33:31 +0000
Received: from khufu.rjmx.net (root@khufu.rjmx.net [192.168.1.2])
by mail.rjmx.net (8.12.11/8.12.11/Debian-3) with ESMTP id i3N1XHtl006488
(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
Thu, 22 Apr 2004 21:33:18 -0400
Received: from khufu.rjmx.net (ron@localhost [127.0.0.1])
by khufu.rjmx.net (8.12.11/8.12.11/Debian-3) with ESMTP id i3N1XHJg002801
(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
Thu, 22 Apr 2004 21:33:17 -0400
Received: (from ron@localhost)
by khufu.rjmx.net (8.12.11/8.12.11/Debian-3) id i3N1XHq1002800;
Thu, 22 Apr 2004 21:33:17 -0400
Message-Id: <200404230133.i3N1XHq1002800@khufu.rjmx.net>
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
From: Ron Murray <rjmx@rjmx.net>
To: Debian Bug Tracking System <196865@bugs.debian.org>
Subject: ifupdown: Stopping dhclient3 with -r switch releases current lease
Reply-To: Ron Murray <rjmx@rjmx.net>
X-Mailer: reportbug 2.56
Date: Thu, 22 Apr 2004 21:33:17 -0400
Delivered-To: 196865@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-7.0 required=4.0 tests=BAYES_00,HAS_PACKAGE
autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level:
X-CrossAssassin-Score: 1
Package: ifupdown
Version: 0.6.4-4.8
Severity: normal
Followup-For: Bug #196865
When you use the -r switch to terminate dhclient3, it releases the
current lease. This might be fine for a PPP system, but there are many
situations when it's annoying. For example, my Internet connection is
via cable modem. I have my own domain whose DNS is at Zoneedit. With
the new ifdown script, I'll lose my current IP address if I reboot the
box, and that means going through the hassles of propagating the new
IP address through DNS. I'm sure people will think of other reasons
why this is a bad idea.
If you really must allow for releasing the lease on shutdown, at least
provide a configuration switch somewhere, perhaps in
/etc/network/interfaces, so the rest of us can ignore it.
Note that, according to the dhclient man page, releasing the current
lease on shutdown is not required by the DHCP protocol.
.....Ron
- -- System Information:
Debian Release: testing/unstable
APT prefers testing
APT policy: (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.5-khufu-1
Locale: LANG=C, LC_CTYPE=C
Versions of packages ifupdown depends on:
ii debconf [debconf-2.0] 1.4.21 Debian configuration management sy
ii libc6 2.3.2.ds1-11 GNU C Library: Shared libraries an
ii net-tools 1.60-9 The NET-3 networking toolkit
- -- debconf information:
ifupdown/convert-interfaces: true
iD8DBQFAiHJditqjxNhsdN4RAlIEAKCTE9pIqaboaGOt8q89HwabcUW1YACeLzm3
Y9GnNL/4+Phzv8r2/wMqb5c=
=9tmL
-----END PGP SIGNATURE-----
Return-path: <jdthood@yahoo.co.uk>
Received: from post-20.mail.nl.demon.net [194.159.73.1]
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1BHKNX-0004PG-00; Sat, 24 Apr 2004 03:27:24 -0700
Received: from [82.161.38.140] (helo=thanatos)
by post-20.mail.nl.demon.net with esmtp (Exim 3.36 #2)
id 1BHKNX-000Daz-00
for 196865-submitter@bugs.debian.org; Sat, 24 Apr 2004 10:27:23 +0000
Received: from localhost (localhost [127.0.0.1])
by thanatos (Postfix) with ESMTP id 15D6510D66E
for <196865-submitter@bugs.debian.org>; Sat, 24 Apr 2004 12:27:16 +0200 (CEST)
Subject: What to do?
From: Thomas Hood <jdthood@yahoo.co.uk>
To: 196865-submitter@bugs.debian.org
Content-Type: text/plain
Message-Id: <1082802435.4773.501.camel@localhost>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.5
Date: Sat, 24 Apr 2004 12:27:16 +0200
Content-Transfer-Encoding: 7bit
Delivered-To: 196865-submitter@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-2.0 required=4.0 tests=BAYES_00 autolearn=no
version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level:
X-CrossAssassin-Score: 1
The motivation behind filing #196865 was to stop dhclient in such
a way that the latter would execute its exit hook script. If we
can't do this by doing "dhclient -r" (because we don't want leases
to be released) then how can we do it?
--
Thomas
Return-path: <rjmx@rjmx.net>
Received: from rwcrmhc11.comcast.net [204.127.198.35]
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1BHjEv-0001ss-00; Sun, 25 Apr 2004 06:00:09 -0700
Received: from mail.rjmx.net (rjmx.net[24.218.135.94])
by comcast.net (rwcrmhc11) with ESMTP
id <20040425125938013004mbcpe>; Sun, 25 Apr 2004 12:59:38 +0000
Received: from rjmx.net (ron@khufu.rjmx.net [192.168.1.2])
by mail.rjmx.net (8.12.11/8.12.11/Debian-3) with ESMTP id i3PCxDYB023543
(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
for <196865@bugs.debian.org>; Sun, 25 Apr 2004 08:59:14 -0400
Message-ID: <408BB620.2070404@rjmx.net>
Date: Sun, 25 Apr 2004 08:59:12 -0400
From: Ron Murray <rjmx@rjmx.net>
Reply-To: rjmx@rjmx.net
User-Agent: Mozilla Thunderbird 0.5 (X11/20040306)
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: 196865@bugs.debian.org
Subject: Re: #196865
References: <1082884472.1605.23.camel@localhost>
In-Reply-To: <1082884472.1605.23.camel@localhost>
X-Enigmail-Version: 0.83.2.0
X-Enigmail-Supports: pgp-inline, pgp-mime
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Delivered-To: 196865@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=0.7 required=4.0 tests=BAYES_00,SUBJ_HAS_UNIQ_ID
autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level:
X-CrossAssassin-Score: 1
Thomas Hood wrote:
Hi.
I've done some thinking about this one. I think what's really needed
is a switch (I'd say -q, but it's already taken) to tell dhclient to
stop, running its exit hooks, but not drop the lease. I've always
thought there should be one anyway; having to stop it by sending a kill
always seemed a little weird to me.
So we need a volunteer to add it. Unless we can persuade upstream to
do it, of course. I'd be prepared to look into it if everyone thinks
it's a good idea.
.....Ron
Return-path: <jdthood@yahoo.co.uk>
Received: from post-20.mail.nl.demon.net [194.159.73.1]
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1BHlkP-00011Z-00; Sun, 25 Apr 2004 08:40:49 -0700
Received: from [82.161.38.140] (helo=thanatos)
by post-20.mail.nl.demon.net with esmtp (Exim 3.36 #2)
id 1BHlkN-000HUX-00; Sun, 25 Apr 2004 15:40:47 +0000
Received: from localhost (localhost [127.0.0.1])
by thanatos (Postfix) with ESMTP
id 7292010D6A5; Sun, 25 Apr 2004 17:40:46 +0200 (CEST)
Subject: Re: Bug#196865: #196865
From: Thomas Hood <jdthood@yahoo.co.uk>
To: rjmx@rjmx.net, 196865-quiet@bugs.debian.org
In-Reply-To: <408BB620.2070404@rjmx.net>
References: <1082884472.1605.23.camel@localhost> <408BB620.2070404@rjmx.net>
Content-Type: text/plain
Message-Id: <1082907646.1603.88.camel@localhost>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.5
Date: Sun, 25 Apr 2004 17:40:46 +0200
Content-Transfer-Encoding: 7bit
Delivered-To: 196865-quiet@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-2.3 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER,
SUBJ_HAS_UNIQ_ID autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level:
X-CrossAssassin-Score: 1
What would happen if ifdown merely "paused" the client in the sense
of the word 'pause' used in the "THE CONTROL OBJECT" section of
dhclient3(8)? According to the man page "this unconfigures any
interfaces the client is using" without releasing the lease.
I have just tried to do this by running the omshell command but I
didn't get anywhere:
jdthood@thanatos:~$ omshell
> connect
dhcpctl_connect: connection refused
I don't know what to do next.
--
Thomas
Return-path: <rjmx@rjmx.net>
Received: from rwcrmhc12.comcast.net [216.148.227.85]
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1BICZV-00033t-00; Mon, 26 Apr 2004 13:19:21 -0700
Received: from mail.rjmx.net (rjmx.net[24.218.135.94])
by comcast.net (rwcrmhc12) with ESMTP
id <2004042620185001400i8335e>; Mon, 26 Apr 2004 20:18:50 +0000
Received: from khufu.rjmx.net.rjmx.net (ron@khufu.rjmx.net [192.168.1.2])
by mail.rjmx.net (8.12.11/8.12.11/Debian-3) with ESMTP id i3QKIT3j015864;
Mon, 26 Apr 2004 16:18:29 -0400
Date: Mon, 26 Apr 2004 16:18:29 -0400
Message-ID: <8765bmlch6.wl%rjmx@rjmx.net>
From: Ron Murray <rjmx@rjmx.net>
To: Thomas Hood <jdthood@yahoo.co.uk>
Cc: 196865-quiet@bugs.debian.org
Subject: Re: Bug#196865: #196865
In-Reply-To: <1082907646.1603.88.camel@localhost>
References: <1082884472.1605.23.camel@localhost>
<408BB620.2070404@rjmx.net>
<1082907646.1603.88.camel@localhost>
User-Agent: Wanderlust/2.11.24 (Wonderwall) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.3 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI)
Reply-To: rjmx@rjmx.net
MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka")
Content-Type: text/plain; charset=US-ASCII
Delivered-To: 196865-quiet@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-2.3 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER,
SUBJ_HAS_UNIQ_ID autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level:
X-CrossAssassin-Score: 1
At Sun, 25 Apr 2004 17:40:46 +0200,
Thomas Hood <jdthood@yahoo.co.uk> wrote:
today, and although the documentation is very, very poor (read:
nonexistent), I managed to get some results.
First off, you need to have
omapi port <number>;
in your dhclient.conf. Without this, it doesn't even start up the
omapi interface. You can use an arbitrary port number for <number>;
I'd leave 7911 free in case you want to do the same thing on dhcpd and
I don't know whether they can coexist on the same port or not.
The dhcpd.conf man page claimed the syntax was
omapi-port <number>;
but that didn't work.
Then start up omshell: lines beginning with '>' are entered by the
user:
ron@khufu:~$omshell
obj: <null> # (server response)
obj: control
obj: control
state = 00:00:00:04 # Server prints current state
obj: control
state = 3
The above seems to suspend DHCP quite successfully. You can then
try and un-suspend it by setting the state to 4, but this didn't seem
to bring the interface back up. Setting the state to 0 did, however.
Note that omshell doesn't seem to have any facility for reading
commands from a file. Probably need some kind of "here document"
syntax in the script.
Return-path: <jdthood@yahoo.co.uk>
Received: from aglu.demon.nl (thanatos) [82.161.38.140]
by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
id 1BJCwl-0000BM-00; Thu, 29 Apr 2004 07:55:31 -0700
Received: from localhost (localhost [127.0.0.1])
by thanatos (Postfix) with ESMTP
id 3DED010D60D; Thu, 29 Apr 2004 16:55:29 +0200 (CEST)
Subject: Re: Bug#196865: #196865
From: Thomas Hood <jdthood@yahoo.co.uk>
To: rjmx@rjmx.net
Cc: 196865@bugs.debian.org
In-Reply-To: <8765bmlch6.wl%rjmx@rjmx.net>
References: <1082884472.1605.23.camel@localhost> <408BB620.2070404@rjmx.net>
<1082907646.1603.88.camel@localhost> <8765bmlch6.wl%rjmx@rjmx.net>
Content-Type: text/plain
Message-Id: <1083250527.3026.105.camel@localhost>
Mime-Version: 1.0
X-Mailer: Ximian Evolution 1.4.5
Date: Thu, 29 Apr 2004 16:55:28 +0200
Content-Transfer-Encoding: 7bit
Delivered-To: 196865@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2004_03_25
(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-2.3 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER,
SUBJ_HAS_UNIQ_ID autolearn=no version=2.60-bugs.debian.org_2004_03_25
X-Spam-Level:
X-CrossAssassin-Score: 1
On Mon, 2004-04-26 at 22:18, Ron Murray wrote in part:
It did for me too. I put logging commands into dhclient-script
and observed that on transition to state 3 the script gets run
with reason == STOP. The interface is deconfigured but left
"UP" according to ifconfig.
It did for me. The interface was configured again (inet_addr,
Bcast and Mask were assigned the values they had prior to the
suspend) and the dhclient-script was run with reason == REBOOT.
Setting the state to 0 appeared to do nothing in my case.
The script appended below (watch out for line wrapping) suspends and
then kills the dhclient3 program given a kernel interface name and
the dhclient process's omapi port as arguments. It works on my
system (dhcp3-client 3.0+3.0.1rc13-1). Implementing this idea in
ifup involves, additionally, selecting a different port number for
each instance of dhclient3 and its using that port number to
suspend+kill the daemon as below.
// Thomas Hood
#!/bin/sh
MYNAME="${0##*/}"
IFACE="$1"
PORT="$2"
report_err() { echo "${MYNAME}: Error: $*" >&2 ; }
read PID crap < /var/run/dhclient.$IFACE.pid
[ "$PID" ] || { report_err "Could not get PID" ; exit 1 ; }
TARG_STATE=3
OMSHELL_CMDS="
port $PORT
connect
new control
open
set state = $TARG_STATE
update
"
echo "$OMSHELL_CMDS" | omshell
start-stop-daemon --stop --pidfile="/var/run/dhclient.$IFACE.pid"
--retry=1 --signal=TERM