Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 31 Aug 2007 18:59:02 +0200
From:      Tobias Roth <freebsd.lists@fsck.ch>
To:        Sean Bruno <sbruno@miralink.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: rc functions don't allow processes to shutdown
Message-ID:  <46D848D6.3030006@fsck.ch>
In-Reply-To: <46D8470B.9030304@miralink.com>
References:  <46D84609.3080409@miralink.com> <46D84697.800@fsck.ch> <46D8470B.9030304@miralink.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Sean Bruno wrote:
> Tobias Roth wrote:
>> Sean Bruno wrote:
>>  
>>> I noticed that if rc.conf has ntpd_enable="NO", an invocation of
>>> /etc/rc.d/ntpd stop won't actually shut down ntpd.  I checked a couple
>>> of other processes(like net-snmp) and noted the same behavior.
>>>
>>> I would have expected that rc would be able to invoke the stop routines
>>> if a utility is disabled, but apparently the check for enabled/disabled
>>> occurs much too early in the rc handling functions for the stop to fire
>>> off.
>>> I could investigate further, as I am sure that it's a fairly easy fix to
>>> allow the stop functions to be invoked regardless of the enable/disable
>>> state. Does it make sense to anyone else that the rc functions should
>>> be able
>>> to shutdown a process when it has been disabled in rc.conf?
>>>     
>>
>> /etc/rc.d/ntpd forcestop
>>   
> Indeed one could invoke that.  My question is more about what 'stop'
> should or should not do.
> 
> Specifically, should it 'stop' when a process has been disabled?

If 'stop' is the inverse of 'start', then no, as 'start' doesn't start a
service if it is disabled.

I agree that the naming could be improved to make it clear that 'start'
and 'stop' both do their thing in respect of the setting in rc.conf, but
I don't have an idea about how exactly to name them.

Furthermore, using 'force' to do something without consideration of any
ill effects and overriding any configuration is widely accepted.

Because of this and in order to respect POLA, I'd just leave everything
as it is.

Cheers,
Tobias



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?46D848D6.3030006>