How to control and setup service?

Allan Jude allanjude at freebsd.org
Mon Sep 7 16:36:47 UTC 2015


On 2015-09-07 06:44, Lars Engels wrote:
> On Mon, Aug 31, 2015 at 10:57:27AM +0300, Pavel Timofeev wrote:
>> 2015-08-29 12:49 GMT+03:00 Stefan Esser <se at freebsd.org>:
>>> Am 28.08.2015 um 18:51 schrieb Pavel Timofeev:
>>>> Sorry for top posting! It's pretty hard to write email walking under
>>>> heavy rain and umbrella.
>>>> So, I talked about special key, not default behaviour.
>>>> Let me give you an example.
>>>> You got a server (or ten) which was/were somehow configured before you.
>>>> You want to reconfigure it/them. You don't care how and where it's
>>>> already configured, you just want to set particular rcvars and be sure
>>>> that no other rcvars are set.
>>>>
>>>> Before you came it was:
>>>> mysql_enable="YES/NO" # no matter
>>>> mysql_datadir="/mycozystorage/db/mysql"
>>>> mysql_defaults_extra_file="/mycozystorage/mysql/my.cnf"
>>>> mysql_plugin_dir="/somewhere/lib/mysql/plugin"
>>>> mysql_log_error="/mycozystorage/db/mysql/hostname.err"
>>>>
>>>> then you run something like (look at -k key)
>>>> # service -k mysql-server enable set datadir "/mysqldb" log_error
>>>> "/mysqllogs/hostname.err"
>>>> it becomes
>>>> mysql_enable="YES"
>>>> mysql_datadir="/mysqldb"
>>>> mysql_log_error="/mysqllogs/hostname.err"
>>>>
>>>> I. e. sets what requested and deletes rcvars which was not requested.
>>>
>>> I think that the removal of the previous config state should not come
>>> as the side-effect of some "set" command.
>>>
>>> I'd rather introduce a now verb for this purpose, which has the effect
>>> of clearing all previous settings for a service, instead of overloading
>>> the "set" operation.
>>
>> BTW, it's already suggested here https://reviews.freebsd.org/D451
>> it's rcdelete. Not sure if it's good name.
>>
> 
> Back from holidays...
> 
> It would be nice if we could find a consensus what should be done with
> my patch in D451. The code itself works fine for me, but what's still
> unclear is what config files should be touched by it:
> 
> 1 /etc/rc.conf
> 2 /etc/rc.conf.local
> 3 /etc/rc.conf.d/$servicename
> 
> I could add some flags to service(8), e.g. -l to edit rc.conf.local, -d
> for /etc/rc.conf.d.
> 
> But please don't let the review rot any longer. :)
> 
> 

I plan to have a discussion about your review and the right solutions at
the vBSDCon dev summit this friday. Don't worry, your review is not rotting.

-- 
Allan Jude

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 834 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20150907/e2c45d96/attachment.bin>


More information about the freebsd-hackers mailing list