Intermittent network connection problem
Joep L. Blom
jlblom at neuroweave.nl
Fri Dec 18 23:22:27 UTC 2009
NoOp wrote:
> On 12/18/2009 01:34 AM, Joep L. Blom wrote:
>> NoOp wrote:
>>> On 12/17/2009 02:33 PM, Joep L. Blom wrote:
> ...
>>> However, you do realise that 'sudo service samba' invokes /etc/init.d/
>>> scripts for this?
>>>
>>> $ 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 choosen 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":).
>
> Thanks... now try:
> $ sudo service networking restart
>
> $ sudo service networking restart
> restart: Unknown instance:
> :-)
> https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/440179
> [service fails to start/stop/restart a daemon]
>
> $ sudo /etc/init.d/networking restart
> * Reconfiguring network interfaces...
> [ OK ]
>
>
>
Well, Gary, I stand corrected! In 8.04 it works correctly. I hadn't
tried it in Karmic and I hope they solve the bug soon.
Tom H, I detest the changing correct working programs or scripts without
giving a reason. To me it is completely unclear why Debian/Ubuntu has
developed invoke-rc.d which is much less intuitive than service which is
a much older command (IIRMC we had it already in IRIX) and has worked in
all the distributions I have used (besides IRIX in the 90'ies, RH, SuSe,
Fedora and now Ubuntu).
The remark about the environment variables is relevant as some services
tend to use the current variables instead of initialising them anew.
Joep
More information about the ubuntu-users
mailing list