Is there any real difference between
/etc/init.d/networking restart and
invoke-rc.d networking restart (Debian)?
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.
There is no real difference. 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.
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.
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
#!/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]