Monday, February 21, 2005

Debian troubleshooting - shutdown problems and a static IP

It turns out that I missed one problem caused by my upgrade to Debian's testing (3.1) release when I wrote my prior post on the upgrade: on shutdown my machine froze after printing the line "Deconfiguring network interfaces". This meant that I had to do a hard power-down every time I wanted to restart the machine, causing mandatory disk checks on startup. Even though one of the benefits of Linux is that the machine hardly ever needs to be rebooted, this was still annoying, so I set about trying to solve the problem.

Unfortunately, the system log daemon terminated before the system lock was occurring, so there was no log of the freeze. Thus, my first step in diagnosing the problem was to add "-v" to the ifdown command in the /etc/init.d/networking file on the line after the "deconfiguring network interfaces" echo command (causing the ifdown command to print verbose output). After shutting down in a terminal window, I discovered that the machine was freezing after printing the lines "run -ports /etc/network/if-down.d" and "pump -i eth0 -r". I looked all over, and got help on the Debian IRC channel, but couldn't find what would cause Debian to freeze after this pump line.

I then found this message on an e-mail list describing a nearly identical problem. The message's suggested hack was to try deleting the components of the /etc/network/ifstate file before shutting down. I tried this, it worked, and thus I did as they suggested and added the line "echo -n > /etc/network/ifstate" to the /etc/init.d/networking file just before the ifdown command that was being run on shutdown. After making the change the system rebooted multiple times without a hitch.

A few days after enacting this workaround I decided to look into pump to see if it could use a static IP, and realized that since I was behind a router I likely didn't need pump (or any dhcp service) at all. To get rid of the dhcp service I removed the "iface eth0 inet dhcp" line from the /etc/network/interfaces file and replaced it with "iface eth0 inet static", following it with configuration options to use a static IP I knew was available on my home network (192.168.0.x); the man/info page for "interfaces" lists the various options. Since I already had pump running, I was able to use "pump -s" (which gives the status of pump's connection) to discover the proper settings.

After configuring the static IP address and restarting the network, I was able to remove the line I'd added to the /etc/init.d/networking file, and the system rebooted without problem.

No comments: