From owner-freebsd-hackers@freebsd.org Mon Aug 31 07:57:29 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 67D359C61AA for ; Mon, 31 Aug 2015 07:57:29 +0000 (UTC) (envelope-from timp87@gmail.com) Received: from mail-wi0-x22b.google.com (mail-wi0-x22b.google.com [IPv6:2a00:1450:400c:c05::22b]) (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 035891520; Mon, 31 Aug 2015 07:57:29 +0000 (UTC) (envelope-from timp87@gmail.com) Received: by widfa3 with SMTP id fa3so15379859wid.1; Mon, 31 Aug 2015 00:57:27 -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=ilWu1fBvdDmdSicF9mX2coMYwIFuG9gHBxK7J1MTsAc=; b=ROe0IPPfMUemiMmWaVTPdcsQRsr0KcvWbkcqOzkciAr34Jki1RGYtv0fy6LBfONZa5 HQYgy1JKEa46cExW6CFJmwN8FCh8z/B0U5CjmIeEc+AlxqBfzLSTRfF/TdDfq/k2Q3BK z70WFPtRJ0zd72fDsPS9WD6oNvEmIL3WZSAZvNvIY+3gPxW8UIHK1tucy851/Z7QC9Ed mkG9pxzYMhT2zbN5MHDAhMkk33SBDcR1NxFl7GzshI6eUjti3eE/rUuaDkyEBf9HgUIa 4cZ6ocJzDiZXkAxv+HLziSzCEe/Lw/O+uiLyMsYr+O6efwu1o8rZylATjFMhFIiG7BiP It4g== MIME-Version: 1.0 X-Received: by 10.194.2.9 with SMTP id 9mr24731001wjq.95.1441007847546; Mon, 31 Aug 2015 00:57:27 -0700 (PDT) Received: by 10.28.9.195 with HTTP; Mon, 31 Aug 2015 00:57:27 -0700 (PDT) In-Reply-To: <55E1803E.7080706@freebsd.org> References: <55DF261C.80009@freebsd.org> <20150827200534.GH16003@e-new.0x20.net> <55E086D3.1040700@freebsd.org> <55E1803E.7080706@freebsd.org> Date: Mon, 31 Aug 2015 10:57:27 +0300 Message-ID: Subject: Re: How to control and setup service? From: Pavel Timofeev To: Stefan Esser Cc: 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, 31 Aug 2015 07:57:29 -0000 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. > > 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