From owner-freebsd-questions@FreeBSD.ORG Mon Nov 21 14:54:30 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AAFC616A41F for ; Mon, 21 Nov 2005 14:54:30 +0000 (GMT) (envelope-from micahjon@ywave.com) Received: from smtpout1.ywave.com (ycomradius.yelmtel.com [216.227.100.60]) by mx1.FreeBSD.org (Postfix) with SMTP id 5820A43D45 for ; Mon, 21 Nov 2005 14:54:30 +0000 (GMT) (envelope-from micahjon@ywave.com) Received: (qmail 14026 invoked by uid 502); 21 Nov 2005 14:54:28 -0000 Received: from dsl28217.ywave.com (HELO ?192.168.1.65?) (micahjon@ywave.com@216.227.115.217) by 0 with SMTP; 21 Nov 2005 14:54:28 -0000 X-CLIENT-IP: 216.227.115.217 X-CLIENT-HOST: dsl28217.ywave.com Message-ID: <4381DFA3.90606@ywave.com> Date: Mon, 21 Nov 2005 06:54:27 -0800 From: Micah User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051112) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Beattie References: <011e01c5ee41$a8a18610$c801a8c0@nexpc> <20051121140830.M11345@pobox.sk> <20051121142219.GA41185@thoron.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: martinko , freebsd-questions@freebsd.org, "Halldor R. Haflidason" Subject: Re: starting services? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Nov 2005 14:54:30 -0000 Michael Beattie wrote: > On 11/21/05, Halldor R. Haflidason 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