How to control and setup service?

Pavel Timofeev timp87 at gmail.com
Mon Sep 7 14:59:38 UTC 2015


2015-09-07 13:44 GMT+03:00 Lars Engels <lars.engels at 0x20.net>:
> 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.

I like an approach when /etc/rc.conf is a default place, and another
default place is controlled through such flags.

>
> But please don't let the review rot any longer. :)

Well, I'd reread this mail chain from the beginning.
If you don't mind I could make a list of items/ideas, which can be
discussed/approved/dropped then.

>


More information about the freebsd-hackers mailing list