Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Here is a situation when I do
root@skd:~# service networking restart
restart: Unknown instance:

and when I do
root@skd:~# service networking stop
stop: Unknown instance:

now if I do

/etc/init.d/networking stop  
  * Deconfiguring network interfaces...       Ignoring unknown interface eth1=eth1.
[ OK ]

note above I did not used service command and it shows working.

and now if I start it in same way I get a warning.

/etc/init.d/networking start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service networking start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start networking
networking stop/waiting

In any case either service command or using /etc/init.d/networking with restart does not do any thing. It does not work and neither does it start.Is it ia problem with Ubuntu 10.04 that service utility does not work properly?

share|improve this question
add comment

3 Answers 3

up vote 2 down vote accepted

I digged a bit more into this problem and found following two commands will help you to find what is active on your system.

status networking
status network-manager

(status is short for "initctl status") or

service networking status
service network-manager status

In my case it was the second command of above

status network-manager
network-manager start/running, process 1096

Once you determine which one's active (whichever applies):

restart networking/restart network-manager

(restart is short for "initctl restart") or

service networking restart/service network-manager restart



network-manager = Network Manager controls the NIC configuration
networking = /etc/network/interfaces controls the NIC's configuration

both are different.So if I restart networking it wont have any effect as network-manager is active.Files worth looking are /etc/init (this is different from init.d)

share|improve this answer
add comment

Ubuntu 10.04 uses the upstart system for the network startup scripts, so restart networking theoretically should be the restart method. BUT it does not seem to work. /etc/init.d/networking stop; /etc/init.d/networking start does work. (From this thread, the problem appears to be upstart's need for some sort of process to grab on to - http://osdir.com/ml/ubuntu-users/2009-11/msg03490.html)

From the error shown with the start, I think you may have a typo in /etc/network/interfaces. See this link for info on setup of the file:

https://help.ubuntu.com/10.04/serverguide/C/network-configuration.html#static-ip-addressing

See the interfaces man page for a full breakdown of options. Once that error is not present when you run a startup, you should be good.

share|improve this answer
add comment

Another option is to use ifdown and ifup for restarting interfaces. So something like:

ifdown eth0 && ifup eth0

Or if your currently using SSH it's probably a good idea to use nohup so it completes the restart even if SSH drops:

nohup sh -c "ifdown eth0 && ifup eth0"
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.