Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any real difference between /etc/init.d/networking restart and invoke-rc.d networking restart (Debian)?

share|improve this question
There is also service networking restart. Unfortunately I don't know enough to give you a detailed comparison of the 3 methods, except that running the /etc/init.d/ script is more "low-level" than the others. – jw013 May 9 '12 at 12:06
up vote 6 down vote accepted

What invoke-rc.d does is documented in its man page. It is a wrapper around running the init script directly, but it also applies a policy that may cause the command not to be run, based on the current runlevel and whether the daemon should be run in that runlevel.

By default, Debian does not differentiate between runlevels 2-5, but as the local administrator, you can change what is run in each runlevel. invoke-rc.d will honor these local policies and not start a daemon if the runlevel is wrong.

share|improve this answer

There is no real difference[1]. The invoke-rc.d command simply provides a nice convenient interface for running the init.d scripts, sparing you the onerous responsibility of typing in the full path to the script you want to run! Both invocations will achieve the same end result.

[1] Note that the invoke-rc.d command performs checks before invoking the requested service script to ensure it should be run - it guards against calling scripts in the wrong runlevel, etc, so in that sense, there is a difference - it protects you from shooting your feet somewhat. The man page should prove instructive in this regard.

share|improve this answer

Another easy method to perform the network restart is to create the following bash file, called in my case [net] ie: /etc/init.d/net

The script:

#!/bin/sh -e
invoke-rc.d networking stop ;  invoke-rc.d networking start ; ifup eth0 

#Add whatever interfaces you have installed. ie: ifup eth0 wlan0 etc 

After creation chmod 711 'the filename' [net]

share|improve this answer

Your Answer


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.