Intermittent network connection problem

Tom H tomh0665 at gmail.com
Fri Dec 18 13:26:45 UTC 2009


>> $ sudo service samba
>> Usage: /etc/init.d/samba {start|stop|reload|restart|force-reload|status}

>> So I'm not entirely clear (yet) what the difference would be using
>> 'service samba' vs /etc/init.d/samba is.

> Well, looking at man service it says:
> <quote>
>  service is a command-line interface to  execute  System  V  style  init
>  script /etc/init.d/name actions.
> <quote>
> I found a nice explanation with Google:
>> http://ubuntu-tutorials.com/2007/11/13/service-tool-available-on-ubuntu-710/
> Which says:
> <quote>
> The difference between /etc/init.d and service is that service sets all
> environment variables as they are when calling the init-scripts at boot.
> When doing /etc/init.d you may inherit some variables from the shell you
> call it from.
> <quote>
> There are more interesting remarks in that tutorial, especially now
> ubuntu has chosen for upstart (why??)
> It also points to a more debian-related analogue invoke-rc.d. I knew it
> existed but I never used it.
> As I'm coming from Fedora/Red Hat, I use service intuitively, e.g. when
> fiddling with networks, etc. and I agree with one of the commenters,
> "spread the use of service":).

invoke-rc.d is definitely the "correct" Debian/Ubuntu tool.
"update-rc.d/invoke-rc.d" are the Debian/Ubuntu equivalent of
"chkconfig/service" in the RHEL/Fedora environment.

The "environment variable" explanation is unconvincing. There are
*nixes with neither invoke-rc.d nor service and neither they nor
Ubuntu/Debian/RHEL/Fedora have ever suffered from calling
/etc/init.d/script directly.

If an init/init.d/event.d script has been converted to upstart, it can
be started or stopped with "start script" or "stop script".




More information about the ubuntu-users mailing list