How to control and setup service?

Pavel Timofeev timp87 at gmail.com
Fri Aug 28 16:51:19 UTC 2015


2015-08-28 19:17 GMT+03:00 Pavel Timofeev <timp87 at gmail.com>:
> A special key, not defaul behaviour
>
> 28 авг. 2015 г. 19:05 пользователь "Allan Jude" <allanjude at freebsd.org>
> написал:
>
>> On 2015-08-28 12:03, Pavel Timofeev wrote:
>> > One more idea is to have a key that would delete from rc config file any
>> > other rcopts which are not being set by tool when user run it.
>> > Like delete all of already defined rcopts and then set only requested
>> > rcopts.
>>
>> That is a big vague.
>>
>> If I understand correctly, you are saying, if you 'service mysql
>> disable', you want it to delete mysql_datadir= ?
>>
>> I am not sure I like that. There is no harm in having the leftover
>> variables left in place, and there is harm if you remove stuff people
>> were expecting to keep around (if I say, disable the sql server before
>> upgrading, and I don't want it to restart until I am sure my upgrade and
>> 3 reboots have all gone successfully)
>>
>> --
>> Allan Jude
>>
>


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.


More information about the freebsd-hackers mailing list