From owner-freebsd-hackers@freebsd.org Fri Aug 28 16:51:19 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 5264F9C303B for ; Fri, 28 Aug 2015 16:51:19 +0000 (UTC) (envelope-from timp87@gmail.com) Received: from mail-wi0-x22f.google.com (mail-wi0-x22f.google.com [IPv6:2a00:1450:400c:c05::22f]) (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 E0B45D8B; Fri, 28 Aug 2015 16:51:18 +0000 (UTC) (envelope-from timp87@gmail.com) Received: by wicfv10 with SMTP id fv10so17314946wic.0; Fri, 28 Aug 2015 09:51:17 -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:content-transfer-encoding; bh=xkKOQuxaQW5WmjDhBvGA1xYRCrixeSlPO3oodll+MLo=; b=bhK3TzragDCmD1BXm1g3BhSLr2x9pV9kOpqBmNnsZjbl/ePxNXDINEqI0CLjKLAhQu BFjU836YTQJxbzROwtRRWJpmPo0hdGU6sNioD73MOjZKedyV6g2+6xB7XSvEQNIaWThv n0uquiUTRrs1W6ZkODBzBKnmP9BRkDuZIBSLd3AGiMlqUS48umnCl57fyKUt0lpybPWr DWynlE40uxGEHXw6eIMJHr8Kcgptk8dQQo/ocPncVdm6bY4Py8TizhQmGf0Fa58XqkOV HxsqpxOo17pbfx3BUSJsHMdm3FgzsN8GSS87DpC9MRg9ujJ9gEVG64/GEZBSYP11mPfo GuVQ== MIME-Version: 1.0 X-Received: by 10.194.172.233 with SMTP id bf9mr12448375wjc.107.1440780677253; Fri, 28 Aug 2015 09:51:17 -0700 (PDT) Received: by 10.28.9.195 with HTTP; Fri, 28 Aug 2015 09:51:17 -0700 (PDT) In-Reply-To: References: <55DF261C.80009@freebsd.org> <20150827200534.GH16003@e-new.0x20.net> <55E086D3.1040700@freebsd.org> Date: Fri, 28 Aug 2015 19:51:17 +0300 Message-ID: Subject: Re: How to control and setup service? From: Pavel Timofeev To: Allan Jude Cc: freebsd-hackers@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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: Fri, 28 Aug 2015 16:51:19 -0000 2015-08-28 19:17 GMT+03:00 Pavel Timofeev : > 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" > =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.