You are not logged in.

#1 2003-05-13 12:00:43

Gyroplast
Member
From: Germany
Registered: 2002-09-03
Posts: 166
Website

DHCP can not run automatically on bootup after hard shutdown

Morning!

There is a slight problem with the dhcpcd daemon tool. When started, it creates a pid file in it's configuration dir, which lies in /etc/dhcpc by default. As long as this file exists, dhcpcd will not start (again). Unfortunately, after a bad crash, powerloss, or otherwise induced hard shutdown, this file is not deleted, and the /etc/rc.d/network script fails to start dhcpcd on bootup because of the persistent existance of this file. A cheap workaround is to simply add an rm -f <configdir>/*.pid before the dhcpcd call in the network script, but that's a bit too much of a workaround for my taste, as I'd prefer the pid file to be created where it belongs, below /var/run, and automatically cleaned on bootup to prevent such problems.

-- EDIT
I just remember that this is only tested on a machine using relatively old packages, from the beginning of the 0.4 release, so I'm not sure whether this is fixed already somehow. At least the pid file is still in /etc/dhcpc/, though.
-- EDIT

Does anyone see a more.. elegant way to accomplish the remedication of this problem?

Greets,
Dennis


"That's the problem with good advice. Nobody wants to hear it."
-- Dogbert

Offline

#2 2003-05-13 14:26:27

netkrash
Member
From: Viña del Mar, Chile.
Registered: 2003-03-19
Posts: 95

Re: DHCP can not run automatically on bootup after hard shutdown

this is interesting..

maybe we should save all the pid files from bootup daemonds to one single dir, then at boot up erase them.

it is a nice suggestion.

anyway that's the workaround is not elegant but it works..


GNU/Linux: Share & Enjoy!

Offline

#3 2003-05-13 22:54:39

apeiro
Daddy
From: Victoria, BC, Canada
Registered: 2002-08-12
Posts: 771
Website

Re: DHCP can not run automatically on bootup after hard shutdown

Yea, this problem should be fixed in the current version of initscripts.

if [ "$new_ifline" = "dhcp" ]; then
          # remove the .pid file if it exists
          rm -f /etc/dhcpc/dhcpcd-${ifline}.pid >/dev/null 2>&1
          /usr/sbin/dhcpcd -D -H -h $HOSTNAME $ifline || stat_die

Offline

Board footer

Powered by FluxBB