Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 Aug 2015 10:59:04 +0300
From:      Pavel Timofeev <timp87@gmail.com>
To:        Allan Jude <allanjude@freebsd.org>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: How to control and setup service?
Message-ID:  <CAAoTqfscq6DVc66pPcoeZ8y0J_oFtCkSD=W47fk30dnpN2nU8g@mail.gmail.com>
In-Reply-To: <55E1CA2D.5020203@freebsd.org>
References:  <CAAoTqfvxUznJp%2BtguAaYQ=5HfKXTG%2BGxY644wvqm4e9=E8WuHw@mail.gmail.com> <55DF261C.80009@freebsd.org> <20150827200534.GH16003@e-new.0x20.net> <CAAoTqfthyGatRokfv-umxjxNp3Qj9xE7A7veDFjQE%2B0PNUdDcA@mail.gmail.com> <CAAoTqfvHfZpdE7QcVGx_BWabdXN68XOGWOcJM33VoKfR7j6Dhw@mail.gmail.com> <55E086D3.1040700@freebsd.org> <CAAoTqfvGXevDtzHEevzuS_kwaezrJftQaY2R4H9UxNnBcEBYfg@mail.gmail.com> <CAAoTqfszP7a1ULNgZO43H_wTzjZu_kNj0n_kY5Skyj85FYUdNg@mail.gmail.com> <55E1803E.7080706@freebsd.org> <55E1CA2D.5020203@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2015-08-29 18:05 GMT+03:00 Allan Jude <allanjude@freebsd.org>:
> On 2015-08-29 05:49, Stefan Esser wrote:
>> 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.
>>
>> E.g.:
>>
>> # service mysql-server clearconfig
>>
>> Not sure about the best command name to use, it could also be "clean"
>> or "initconfig" or "defaultconfig". The semantics is that all the
>> rc.conf assignments for thise service are removed (including the
>> enable line) and the defaults from defaults/rc.conf become effective
>> again.
>>
>> Regards, STefan
>> _______________________________________________
>> freebsd-hackers@freebsd.org mailing list
>> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
>> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
>>
>
> I agree that that is a better design, as I would almost never actually
> want to remove those extra settings, and if it happened unexpectedly, I
> would be quite upset.

I suggested special key for that, so it can't happen unexpectedly, IMO.


>
> --
> Allan Jude
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAoTqfscq6DVc66pPcoeZ8y0J_oFtCkSD=W47fk30dnpN2nU8g>