dhclient3 hangs on shutdown

Bug #571933 reported by Cody Herriges
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
dhcp3 (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

I have been unable to find a reason why but Lucid is having issues shutdown down on all systems I have upgraded. When the reboot command is called almost all processes are killed, including my active ssh sessions. I can immediately log back in via ssh and I find the system hung on `dhclient3 -r -pf /var/run/dhclient.eth0.pid -lf /var/lib/dhcp3/dhclient.eth0.leases eth0` with only a few more processes running, automount, rpc.statd, portmap. The only thing that will allow the system to finish shutting down is killing dhclient3, killing any other process doesn't change the state of the hang. I have tested the networking scripts outside of shutdown and they are all functioning properly. Running strace on the dhclient3 PID leads to nothing stopping immediately on a read. Ps shows the process as in a sk_wait state.

Revision history for this message
Cody Herriges (ody-cat) wrote :

Something else I have noticed about this. During normal operation when dhclient3 is running the dhclient.eth0.pid file properly exists. In this weird state that I am reporting the file does not exist.

Revision history for this message
Cody Herriges (ody-cat) wrote :

Just found something else. After initiating reboot and then logging back in via ssh this is what is at the very end of dmesg.

[ 590.532915] type=1503 audit(1272598521.696:18): operation="capable" pid=2139 parent=2138 profile="/sbin/dhclient3" name="ipc_lock"

affects: ubuntu → dhcp3 (Ubuntu)
Revision history for this message
Cody Herriges (ody-cat) wrote :

I think my previous two comments really have nothing to do with the actual problem. Me just grasping at straws trying to find some kind of information. The following patch is a hack and not anywhere close to a solution but does make the /etc/init.d/networking script complete during shutdown.

Revision history for this message
C de-Avillez (hggdh2) wrote :

Thank you for opening this bug and helping make Ubuntu better. On Lucid network startup/shutdown should be done via upstart (/etc/init/), not via /etc/init.d.

Could you please give us logs for a shutdown with this issue?

Changed in dhcp3 (Ubuntu):
status: New → Incomplete
Revision history for this message
Cody Herriges (ody-cat) wrote : Re: [Bug 571933] Re: dhclient3 hangs on shutdown

On 05/03/2010 07:23 AM, C de-Avillez wrote:
> Thank you for opening this bug and helping make Ubuntu better. On Lucid
> network startup/shutdown should be done via upstart (/etc/init/), not
> via /etc/init.d.
>
> Could you please give us logs for a shutdown with this issue?
>
> ** Changed in: dhcp3 (Ubuntu)
> Status: New => Incomplete
>

Suggestions on how to get proper logging to a file on a shutdown?

Thanks,

Revision history for this message
Cody Herriges (ody-cat) wrote :

Went ahead and modified /etc/init.d/networking to provide straces of the ifdown command that is runs on a stop action.

running.png is a screen shot of my VM's normal output when running `/etc/init.d/networking stop
shutdown.png is a screen shot of the same VM's shutdown logging.

running.strace is a strace of the ifdown command that is being initiated by `/etc/init.d/networking stop` when ran while the system is in a normal up condition.
shutdown.strace is the same strace but when the ifdown command is ran by `/etc/init.d/networking stop` during the normal shutdown procedures triggered by `/etc/rc6.d/S35networking`.

Revision history for this message
Cody Herriges (ody-cat) wrote :
Revision history for this message
Cody Herriges (ody-cat) wrote :
Revision history for this message
Cody Herriges (ody-cat) wrote :
Revision history for this message
Cody Herriges (ody-cat) wrote :
Revision history for this message
Andrea Ratto (andrearatto) wrote :

It seems that the DHCP server does not reply to DHCPRELEASE so dhclient waits until timeout.
My DSL modem does the same.
My workaround is to remove /etc/rc0.d/S35networking and /etc/rc6.d/S35networking, but I would like to know if there is a way to configure dhclient to ignore release requests, without messing with init scripts.

Also on reboots the client should NOT release the address according to the protocol, so maybe this is ALSO a bug in the init scripts.

Revision history for this message
Cody Herriges (ody-cat) wrote :

On 05/07/2010 10:19 AM, Andrea Ratto wrote:
> It seems that the DHCP server does not reply to DHCPRELEASE so dhclient waits until timeout.
> My DSL modem does the same.
> My workaround is to remove /etc/rc0.d/S35networking and /etc/rc6.d/S35networking, but I would like to know if there is a way to configure dhclient to ignore release requests, without messing with init scripts.
>
> Also on reboots the client should NOT release the address according to
> the protocol, so maybe this is ALSO a bug in the init scripts.
>

The dhcp server in my case is isc-dhcpd and this doesn't happen for any
Jaunty, Solaris, OSX, or Windows machines. Plus this is only on
shutdown. Stopping or restarting the script while the machine is in a
normal running state does what is expected of it and releases the IP.

Revision history for this message
Andrea Ratto (andrearatto) wrote :

Alright then mine is a different problem.
However in the event of a reboot the dhcp client is not supposed to release the address, since it is going to ask one again in a minute.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for dhcp3 (Ubuntu) because there has been no activity for 60 days.]

Changed in dhcp3 (Ubuntu):
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.