3

I use Ubuntu 14.04 LTS, I try type sudo /etc.init.d/networking restart but no output's displayed and no action excuted.

closed as too broad by slm, strugee, Anthon, Thomas Nyman, Matteo Jun 2 '14 at 11:19

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

4

In /etc/init.d/networking, you can see:

....
force-reload|restart)
        if init_is_upstart; then
                exit 1
        fi
....

And from /lib/lsb/init-functions:

# If the currently running init daemon is upstart, return zero; if the
# calling init script belongs to a package which also provides a native
# upstart job, it should generally exit non-zero in this case.
init_is_upstart()
{
   if [ -x /sbin/initctl ] && /sbin/initctl version 2>/dev/null | /bin/grep -q upstart; then
       return 0
   fi
   return 1
}

Ubuntu 14.04 distro uses upstart as its init daemon, so when you run /etc/init.d/networking restart, it checks the currently running init daemon is upstart or not. If it is upstart, then it simply exits the script.

Note

In my Ubuntu 12.04, there is no init_is_upstart in /etc/lsb/init-functions. Maybe it have been added in newer version of Ubuntu.

4

I remember reading somewhere that using sudo /etc/init.d/networking restart is no longer supported as of 14.04. You could try running sudo ifdown eth0 followed by sudo ifup eth0. Of course you need to replace 'eth0' with whatever interface you need restarted. This should accomplish the same as using the init script.

I found a github repo with a replacement networking script for Ubuntu 14.04 that should make sudo service networking restart work as it did with 13.10. I have not tried the script, but it might be worth looking into.

https://github.com/metral/restore_networking

  • 1
    service network-manager restart works for me in Ubuntu 14.04 – Alexander Farber Feb 23 '15 at 14:18

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