From owner-freebsd-hackers@freebsd.org Mon Sep 7 14:59:38 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 416799CC47A for ; Mon, 7 Sep 2015 14:59:38 +0000 (UTC) (envelope-from timp87@gmail.com) Received: from mail-wi0-x231.google.com (mail-wi0-x231.google.com [IPv6:2a00:1450:400c:c05::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C59531E4F; Mon, 7 Sep 2015 14:59:37 +0000 (UTC) (envelope-from timp87@gmail.com) Received: by wiclk2 with SMTP id lk2so91605140wic.0; Mon, 07 Sep 2015 07:59:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=ueQqSw4VyS9nk2cHXH2MYF0TFgV56NPUvkcx++uMZFY=; b=CPE/J/yhkgxCYpi692cSjdZBpwsnZJ1cz7afaSoWnBQREBGQNvHdJjPRqkKULv3pOJ s9Z8N/tBZFZdwgqkPiYBD1agzo/xmQEP5Pqkv+AQB2sg+GGuwEWl7H2aosxSfqlac32e jFs3EylZvtD3PIVv+WR9WDcqovqbh7db8ADwf13gqT8X/xaEe3a00mWV7BKqqMnE/Up/ PW6FrIcblFHKWcOok4VjriEl/qHgknnIxYR5ya7yEddiUH9TOZt+vZYz+WQablfZlVPN e+gGte1TAp75ri0LT1jopBqipof/1TJm1WofzhDhGwMbBVC0r2m5YruVb2LT1S85Nodn nHEg== MIME-Version: 1.0 X-Received: by 10.180.85.194 with SMTP id j2mr34953686wiz.11.1441637975291; Mon, 07 Sep 2015 07:59:35 -0700 (PDT) Received: by 10.28.9.195 with HTTP; Mon, 7 Sep 2015 07:59:35 -0700 (PDT) In-Reply-To: <20150907104458.GL16003@e-new.0x20.net> References: <55DF261C.80009@freebsd.org> <20150827200534.GH16003@e-new.0x20.net> <55E086D3.1040700@freebsd.org> <55E1803E.7080706@freebsd.org> <20150907104458.GL16003@e-new.0x20.net> Date: Mon, 7 Sep 2015 17:59:35 +0300 Message-ID: Subject: Re: How to control and setup service? From: Pavel Timofeev To: Lars Engels Cc: Stefan Esser , freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 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: Mon, 07 Sep 2015 14:59:38 -0000 2015-09-07 13:44 GMT+03:00 Lars Engels : > On Mon, Aug 31, 2015 at 10:57:27AM +0300, Pavel Timofeev wrote: >> 2015-08-29 12:49 GMT+03:00 Stefan Esser : >> > 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. >> >> BTW, it's already suggested here https://reviews.freebsd.org/D451 >> it's rcdelete. Not sure if it's good name. >> > > Back from holidays... > > It would be nice if we could find a consensus what should be done with > my patch in D451. The code itself works fine for me, but what's still > unclear is what config files should be touched by it: > > 1 /etc/rc.conf > 2 /etc/rc.conf.local > 3 /etc/rc.conf.d/$servicename > > I could add some flags to service(8), e.g. -l to edit rc.conf.local, -d > for /etc/rc.conf.d. I like an approach when /etc/rc.conf is a default place, and another default place is controlled through such flags. > > But please don't let the review rot any longer. :) Well, I'd reread this mail chain from the beginning. If you don't mind I could make a list of items/ideas, which can be discussed/approved/dropped then. >