DebianThis forum is for the discussion of Debian Linux.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I haven't been active in Debian for two years back when Lenny was still in 'testing' and noticed that for some reason it is no longer protocol to restart network services using the 'init.d' scripts. I also noticed the same for Ubuntu (which I don't use or could care about) and am trying to understand what is the correct way now for Debian and what changed? I did a search on Google but didn't turn up any results.
I guess I am really lost. Did Debian change something on how it used to manage restarting services like 'network'? I ran your suggested command and it hung:
root@mail:~# 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...
It never came back so I had to reboot the server. I used to remember when I could run the /etc/init.d/network restart command and it was smooth as butter...I don't understand why this changed. I shouldn't have to reboot for a simple IP change.
sudo /etc/init.d/networking restart
while you have done:
sudo /etc/init.d/network restart
It seems that point is that the /etc/init.d/networking script no longer works with the "restart" argument. The reasoning being that "restart" would just call "stop", which would bring down all interfaces, and then call "start" which would bring up the interfaces marked "auto" in the /etc/network/interfaces file. This is seen as a potential problem, because there may have been interfaces that were up before (perhaps bought up manually), that were not marked "auto" and therefore would not be bought back up on a "restart".
I just got blindsided by this when I upgraded Ubuntu server 10.04 to 12.04--and it took a lot of Googling and experimenting to find the straight dope.
"/etc/init.d/networking restart" works as before; it just now throws a warning that it may not work. This is because most people don't understand what "networking restart" does. When it doesn't work as expected they think it's broken. "networking restart" does not restart interfaces that do not have the auto directive in /etc/network/interfaces (thanks to evo2 for this piece of the puzzle).
"networking restart" works fine with Ubuntu server (as of 12.04) because the network interface has the auto directive by default; it just throws the warning. It does not work with Debian 6 because the auto directive is not in /etc/network/interfaces by default. However, if you add "auto eth0" to the configuration, restart works. This is of course with my setup, i.e. a single wired Ethernet card. Your mileage may vary.
However, lesson learned, I now use "ifdown eth0;ifup eth0" after reconfiguring the interface.