You are not logged in or registered. Please login or register to use the full functionality of this board...
Linuxcat.org
Networking restart is deprecated in debian - Printable Version

+- Linuxcat.org (https://www.linuxcat.org)
+-- Forum: Linux Guides and Troubleshooting (/forumdisplay.php?fid=1)
+--- Forum: Linux Troubleshooting (/forumdisplay.php?fid=3)
+--- Thread: Networking restart is deprecated in debian (/showthread.php?tid=35)



Networking restart is deprecated in debian - ScreechyNutz - 09-01-2011 04:06 PM

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

e.g.

[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...


RE: Networking restart is deprecated in debian - Cambion - 10-17-2011 12:37 PM

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
then
# 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.