Intermittent network connection problem
Joep L. Blom
jlblom at neuroweave.nl
Fri Dec 18 09:34:41 UTC 2009
NoOp wrote:
> On 12/17/2009 02:33 PM, Joep L. Blom wrote:
>> Jim Byrnes wrote:
>>> NoOp wrote:
> ...
>>>> So if you find that samba is not running:
>>>> $ /etc/init.d/samba status
>>>> * could not access PID file for nmbd
>>>> * could not access PID file for smbd
>>>>
>>>> you can restart:
>>>> $ sudo /etc/init.d/samba start
>>>>
>>>> and then you should get the running status again:
>>>> $ /etc/init.d/samba status
>>>> * nmbd is running
>>>> * smbd is running
>>> NoOp,
>>>
>>> Thanks alot for the detailed examples. They will save me a lot of
>>> reboots.
>>>
>>> Also, you helped me redefine the real problem and that is Samba not
>>> starting. I just Googled that and see some hits, so maybe the longterm
>>> solution lies there.
>>>
>>> Thanks again, Jim
>>>
>>>
>> small remark Noop: it's safer to use sudo service samba status instead
>> of the direct use of the scripts in /etc/int.d/
>> Joep
>
> Ah yes... I keep forgetting karmic uses upstart & still haven't gotten
> used to all the 'new & improved' features yet. Thanks.
>
> 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":).
Joep
More information about the ubuntu-users
mailing list