Networking restart is deprecated in debian
|
09-01-2011, 04:06 PM
(This post was last modified: 09-01-2011 04:07 PM by Unkoerl.)
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 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... |
|||
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 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. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)