Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Nov 2005 06:54:27 -0800
From:      Micah <micahjon@ywave.com>
To:        Michael Beattie <mtbeedee@gmail.com>
Cc:        martinko <martinkov@pobox.sk>, freebsd-questions@freebsd.org, "Halldor R. Haflidason" <titan@thoron.org>
Subject:   Re: starting services?
Message-ID:  <4381DFA3.90606@ywave.com>
In-Reply-To: <d4b4435a0511210626n5cb7a7e3od7f091a7a0a4a9e@mail.gmail.com>
References:  <dllcot$4ca$1@sea.gmane.org> <011e01c5ee41$a8a18610$c801a8c0@nexpc>	<20051121140830.M11345@pobox.sk> <20051121142219.GA41185@thoron.org> <d4b4435a0511210626n5cb7a7e3od7f091a7a0a4a9e@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Michael Beattie wrote:
> On 11/21/05, Halldor R. Haflidason <titan@thoron.org> wrote:
> 
>>On Monday, 21 November 2005 at 15:11:35 +0100, martinko wrote:
>>
>>>On Mon, 21 Nov 2005 10:17:01 +0800, Foo Ji-Haw wrote
>>>
>>>>>i wonder why i cannot start for instance ssh with
>>>>>/etc/rc.d/sshd start
>>>>>but i always have to use
>>>>>/etc/rc.d/sshd forcestart
>>>>>and similarly for stop, status, etc.
>>>>>
>>>>>any ideas pls ??
>>>>
>>>>You have to add a line in /etc/rc.conf. I think it is
>>>>samba_enable="YES".
>>>
>>>
>>>well, if you add sshd_enable="YES", the service (always) starts on boot.
>>>
>>>i just want to start it manually and i wonder why it doesn't listen to "start"
>>>argument but only "forcestart" and similarly for other commands i've got to
>>>use "force".
>>>
>>>anyone knows why pls ??
>>>
>>>martin
>>
>>Because when the system boots up it sends the 'start' argument to all the
>>scripts in the rc.d directories, those scripts then check wether they
>>should start or not. Force start simply overrides that check.
>>
>>Halldor
> 
> 
> Then something's broken, no?  If the service isnt running and you send
> it a "start" and it doesnt start, then that's bad.  You shouldnt need
> to override some checks, it should do what it's commanded to do.

Nothing is broken, the script IS doing what it's commanded to do.  rc.d 
scripts are intended to start service at boot time.  The ability to 
start them arbitrarily is a convenience feature.  When the system boots 
it sends ALL of the scripts in the rc.d directory the "start" command. 
The scripts are designed to check rc.conf and if they are not enabled in 
rc.conf, then they do not run (making service management as easy as 
editing one config file).  "forcestart" is a convenience command to 
temporarily enable a service without making it run every time you boot 
the os.  By using it, you are saying "Even though I said DO NOT RUN 
service x, force service x to run."

HTH,
Micah



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4381DFA3.90606>