From owner-freebsd-hackers@freebsd.org Sat Aug 29 15:04:41 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 5C6AA9C48C6 for ; Sat, 29 Aug 2015 15:04:41 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from mx1.scaleengine.net (mx1.scaleengine.net [209.51.186.6]) by mx1.freebsd.org (Postfix) with ESMTP id 201121FE0 for ; Sat, 29 Aug 2015 15:04:40 +0000 (UTC) (envelope-from allanjude@freebsd.org) Received: from [10.1.1.2] (unknown [10.1.1.2]) (Authenticated sender: allanjude.freebsd@scaleengine.com) by mx1.scaleengine.net (Postfix) with ESMTPSA id 1560D95C7 for ; Sat, 29 Aug 2015 15:04:40 +0000 (UTC) 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> <55E1803E.7080706@freebsd.org> From: Allan Jude Message-ID: <55E1CA2D.5020203@freebsd.org> Date: Sat, 29 Aug 2015 11:05:17 -0400 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: <55E1803E.7080706@freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="StKRpSrtvQEjTk7udVAxIiN1p6gjTDStU" 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 15:04:41 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --StKRpSrtvQEjTk7udVAxIiN1p6gjTDStU Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable 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= =2E >> 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. >=20 > I think that the removal of the previous config state should not come > as the side-effect of some "set" command. >=20 > 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. >=20 > E.g.: >=20 > # service mysql-server clearconfig >=20 > 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. >=20 > 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.o= rg" >=20 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. --=20 Allan Jude --StKRpSrtvQEjTk7udVAxIiN1p6gjTDStU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (MingW32) iQIcBAEBAgAGBQJV4coxAAoJEBmVNT4SmAt+hUAP/jcUpJzHnD2NiT7wQiXFc2+H 3KUtNzwc3UjDs5Xmw01iNJHZfrMcvltT4EgkaRuBIDE7h1JGrXJVuQ2fPmbRSLZw n9usA+NCOAD9iCw80rhdW4jltuADJ7/1e7HIUTHjZIgo3AdDYFYMcCRdFWzUiKhk 1lkAdOCZdu5T6KkNdNWbvudTnls1BzR6rL3UA6R/5GN9LREHEFPhbx3Flm1vypIm /fUR/e1NZu2uEdMTogmjv8qhikxSe80rx8UkMcJe10c2mNzvLsx7P4Ba0kiKgQcm rR33wzTyJq4LmaVRkyzeckXIzBVAVkQTYo+5TCiLmG13J19SVynQWx1K+GeH2TbG k6pOmCsdnyr2WUJq7Cturj/aeEFJiPJcs4QUfp8ucvw6UaJqBC8MRdjv3z3SD+Qz UzYd6/s59nRENhvjtqm+HaSqnsolspQZbgSQzvLHznEPSPwIprk77Ra783Mxl7uL 5HYMzsM0HH5CztD9wIPhWMqGDiPUua869rg8bGBntXox1f6SpgZouKB5hB74JcyB HxLOAqDHIfMhkE3LIufr1gBszx9l4liverTz9wmjxCL8VdASJXjNxDuOiRgtkwmq WPlsyHPIpcpyuJqRT0SNYOOgbzVrsWxS2iAn1QbscoB3nqHrjow2fxFGuFIwVOLv xhSldNonVCoz6jlCdETg =MtgZ -----END PGP SIGNATURE----- --StKRpSrtvQEjTk7udVAxIiN1p6gjTDStU--