Results 1 to 6 of 6

Thread: shutdown hangs on deconfiguring network interfaces

  1. #1
    Join Date
    Jul 2008
    Location
    Hickory, NC, USA
    Beans
    33
    Distro
    Ubuntu 11.04 Natty Narwhal

    shutdown hangs on deconfiguring network interfaces

    There are several threads in the forums about karmic not shutting down properly, but none of them were under the exact same circumstances as I'm having.

    I'm using 9.10 server-edition as a intercepting squid server, and during shutdown/reboot, it gets to "deconfiguring network interfaces" then hangs indefinitely. I can do REISUB, but it doesn't actually reboot. It tells me that it's killing everything, the sync completes, and the remount r/o completes, but the "B" part doesn't do anything.

    If I don't REISUB, it hangs for a few minutes on startup before init outputs anything.

    I posted all the useful information I can think of below. In regard to my iptables rules, do I need something on pre/post-down to clear them? Is that the problem?

    Network hardware:
    Code:
    06:01.0 Ethernet controller: ADMtek NC100 Network Everywhere Fast Ethernet 10/100 (rev 11)
    06:08.0 Ethernet controller: Intel Corporation 82562ET/EZ/GT/GZ - PRO/100 VE (LOM) Ethernet Controller (rev 01)
    /etc/network/interfaces: (I have udev rules that set my interface names)
    Code:
    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).
    
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto wan0
         iface wan0 inet static
         address 208.78.184.140
         netmask 255.255.255.128
         gateway 208.78.184.129
    
    auto lan0
           iface lan0 inet static
           address 192.168.2.1
           netmask 255.255.255.0
           pre-up iptables-restore < /etc/iptables.rules
    The iptables commands that were entered for generating /etc/iptables.rules with iptables-save:
    Code:
    # iptables forwarding
    iptables -A FORWARD -i lan0 -o wan0 -s 192.168.2.0/24 -m state --state NEW -j ACCEPT
    iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
    iptables -A POSTROUTING -t nat -j MASQUERADE 
    
    # iptables for squid transparent proxy
    iptables -t nat -A PREROUTING -i lan0 -p tcp --dport 80 -j DNAT --to 192.168.2.1:3128
    iptables -t nat -A PREROUTING -i wan0 -p tcp --dport 80 -j REDIRECT --to-port 3128
    
    iptables -A INPUT -i wan0 -p icmp --icmp-type 8 -j DROP
    iptables -A INPUT -i wan0 -s 192.168.2.0/24 -j ACCEPT
    iptables -A INPUT -i wan0 -m state --state ESTABLISHED -j ACCEPT
    iptables -A INPUT -i wan0 -j REJECT

  2. #2
    Join Date
    Jul 2008
    Location
    Hickory, NC, USA
    Beans
    33
    Distro
    Ubuntu 11.04 Natty Narwhal

    Lightbulb Re: shutdown hangs on deconfiguring network interfaces

    Well, today I decided to just try my idea of clearing iptables on shutdown. It seems to have fixed my hang on deconfiguring network interfaces. If anyone knows of a security problem with this, let me know. I do still sometimes have a hang on startup even with a clean reboot, but I guess this is a different problem.

    For the record, here's the relevant block from my /etc/network/interfaces:

    Code:
    auto lan0
           iface lan0 inet static
           address 192.168.2.1
           netmask 255.255.255.0
           pre-up iptables-restore < /etc/iptables.rules
           pre-down iptables -F ; iptables -t nat -F ; iptables -t mangle -F

  3. #3
    Join Date
    Mar 2011
    Beans
    4

    Re: shutdown hangs on deconfiguring network interfaces

    This didn't fix the problem for me. I finally got it working by troubleshooting like this :

    edit the file /etc/init.d/networking
    change :
    #!/bin/sh -e
    by
    #!/bin/sh -ex

    By doing this, I knew which line of the script got stuck ... It was an interface that was setup for a device that was not plugged in the computer, so it was stuck in an infinite loop. I commented out a part of this script (/etc/init.d/networking) so it would not try to unload the driver..

  4. #4
    Join Date
    Jul 2008
    Location
    Hickory, NC, USA
    Beans
    33
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: shutdown hangs on deconfiguring network interfaces

    Nice tip, mfecteau! I'll have to remember that one!
    chown -R lytithwyn:lytithwyn /*
    You got ch0wnz3d

  5. #5
    Join Date
    Aug 2006
    Beans
    50
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: shutdown hangs on deconfiguring network interfaces

    Tried both of these methods, could not get it to work. the /etc/init.d/networking '-ex' change stopped at the ifdown -a --exclude=lo, showed nothing past that, and I didn't feel like commenting that section out would be a good idea.

    However, I did get it fixed. Went into the rc.6 and rc.0 folders, changed S35networking to S15networking (deconfigure earlier), and it worked just fine. Everything shuts down and reboots properly with no hang.

  6. #6
    Join Date
    Mar 2011
    Location
    England
    Beans
    4
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: shutdown hangs on deconfiguring network interfaces

    Quote Originally Posted by backu View Post
    Tried both of these methods, could not get it to work. the /etc/init.d/networking '-ex' change stopped at the ifdown -a --exclude=lo, showed nothing past that, and I didn't feel like commenting that section out would be a good idea.

    However, I did get it fixed. Went into the rc.6 and rc.0 folders, changed S35networking to S15networking (deconfigure earlier), and it worked just fine. Everything shuts down and reboots properly with no hang.

    Hi, but of a newbie at this I'm afraid.

    I tried all the mentioned fixes, and was hoping that backu's fix would fix things for me.

    Unfortunately changing the names of the above files in my rc0.d & rc6.d folders them prevented the server from booting.. Oppps..

    Anyone got any more Ideas on this.. My system started to hang on shutdown after I installed wpasupplicant (see this thread)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •