Date: Fri, 28 Aug 2015 19:51:17 +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: <CAAoTqfszP7a1ULNgZO43H_wTzjZu_kNj0n_kY5Skyj85FYUdNg@mail.gmail.com> In-Reply-To: <CAAoTqfvGXevDtzHEevzuS_kwaezrJftQaY2R4H9UxNnBcEBYfg@mail.gmail.com> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
2015-08-28 19:17 GMT+03:00 Pavel Timofeev <timp87@gmail.com>: > A special key, not defaul behaviour > > 28 =D0=B0=D0=B2=D0=B3. 2015 =D0=B3. 19:05 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7= =D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C "Allan Jude" <allanjude@freebsd.= org> > =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: > >> On 2015-08-28 12:03, Pavel Timofeev wrote: >> > One more idea is to have a key that would delete from rc config file a= ny >> > 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=3D ? >> >> 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=3D"YES/NO" # no matter mysql_datadir=3D"/mycozystorage/db/mysql" mysql_defaults_extra_file=3D"/mycozystorage/mysql/my.cnf" mysql_plugin_dir=3D"/somewhere/lib/mysql/plugin" mysql_log_error=3D"/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=3D"YES" mysql_datadir=3D"/mysqldb" mysql_log_error=3D"/mysqllogs/hostname.err" I. e. sets what requested and deletes rcvars which was not requested.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAAoTqfszP7a1ULNgZO43H_wTzjZu_kNj0n_kY5Skyj85FYUdNg>