When I restart the network using:
/etc/init.d/networking restart
I get this warning:
Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
So what's the best way to restart the network after making changes now?
This problem also applies to Debian as the netbase package is inherited from debian.
It is just saying that the restart option is going away
Note there is one line only! That is important when running network restart through the network.
Run the init.d command without parameters, it will tell you which is the usage:
Seems that restart is deprecated
It is deprecated also in Debian at least since:
The related bug #550240 here
Which is quite nasty. To restart netwokring from remote probably the best and securest approach will be run the following within a screen session:
As of today's
networking
init script,restart
andforce-reload
will work in most circumstances. I guess it's reasonably safe to ignore the warning and still use restart. However I'll go with the stop + start way :-)I use
nohup sh -c "/etc/init.d/networking stop; sleep 2; /etc/init.d/networking start"
. I addsleep 2
because I think perhaps the issues with restart had something to do with hardware-dependent latencies, but this is unconfirmed and a semi-rule of thumb I'm somewhat ashamed to make public. So you can skip that if you're feeling rational!The command below works well in a server environment, without throwing warnings. It implements both stop and start request on the networking service.
how about
nohup sh -c "ifdown -a && ifup -a"
In Debian Wheezy,
seems to do what is expected and doesn't complain.
I guess in Jessie with systemd it may be different again.
If you can't find the reason networking fails to restart, do it in the verbose mode inside of a
screen
session: