From owner-freebsd-hackers@freebsd.org Sat Aug 29 09:50:12 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 662C59C55CA for ; Sat, 29 Aug 2015 09:50:12 +0000 (UTC) (envelope-from se@freebsd.org) Received: from mailout11.t-online.de (mailout11.t-online.de [194.25.134.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mailout00.t-online.de", Issuer "TeleSec ServerPass DE-1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25C23CB2; Sat, 29 Aug 2015 09:50:12 +0000 (UTC) (envelope-from se@freebsd.org) Received: from fwd24.aul.t-online.de (fwd24.aul.t-online.de [172.20.26.129]) by mailout11.t-online.de (Postfix) with SMTP id DB8E3279944; Sat, 29 Aug 2015 11:50:09 +0200 (CEST) Received: from [192.168.119.17] (rfFR3TZHQhgaiFr7jr7PZm8T5fA5t3oQhiaft6NtGIQx6iu59G76Tl3JENzNP0MgCA@[87.151.208.233]) by fwd24.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-SHA encrypted) esmtp id 1ZVclv-0dSW800; Sat, 29 Aug 2015 11:50:03 +0200 Subject: Re: How to control and setup service? To: freebsd-hackers@freebsd.org References: <55DF261C.80009@freebsd.org> <20150827200534.GH16003@e-new.0x20.net> <55E086D3.1040700@freebsd.org> Cc: timp87@gmail.com From: Stefan Esser X-Enigmail-Draft-Status: N1110 Message-ID: <55E1803E.7080706@freebsd.org> Date: Sat, 29 Aug 2015 11:49:50 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-ID: rfFR3TZHQhgaiFr7jr7PZm8T5fA5t3oQhiaft6NtGIQx6iu59G76Tl3JENzNP0MgCA X-TOI-MSGID: 17a76186-65e0-41bd-8a30-8098a055041c X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Aug 2015 09:50:12 -0000 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