You are not logged in or registered. Please login or register to use the full functionality of this board...

Post Reply 
Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Networking restart is deprecated in debian
09-01-2011, 04:06 PM (This post was last modified: 09-01-2011 04:07 PM by ScreechyNutz.)
Post: #1
Networking restart is deprecated in debian
If you are trying to restart the network daemon, the following code will do that without deprecating it in Debian.

# invoke-rc.d networking restart


[email protected]:~# invoke-rc.d networking restart
Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces ... (warning).
Reconfiguring network interfaces...
Find all posts by this user
Quote this message in a reply
10-17-2011, 12:37 PM
Post: #2
RE: Networking restart is deprecated in debian
Not really, invoke-rc.d is just a wrapper that points to the init scripts and checks sysv init policy to make sure that the action is allowed. They are doing the same thing.

The part that is deprecated is using the init script to restart or force-reload, for example:

with the following in your /etc/network/interfaces:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

running either /etc/init.d/networking restart or invoke-rc.d networking restart would run:

# ifdown -a
# ifup -a

The problem is that ifdown -a will bring down all network interfaces, whereas ifup -a will only bring up any network devices in /etc/network/interfaces that are set to auto, anything with allow-hotplug won't be bought back up until it detects a hotplug event, usually when a network cable is plugged in.

In the example interfaces file above this means that the loopback device will come back up every time, but eth0 won't.

To reliably restart a network interface you can use the following:

# ifdown eth0 && ifup eth0

This will bring the interface down and, once the ifdown command has completed successfully, bring it back up again.
Find all posts by this user
Quote this message in a reply
Post Reply 

Forum Jump:

User(s) browsing this thread: 1 Guest(s)