From owner-freebsd-hackers@freebsd.org Fri Aug 28 16:03:02 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 AB6899C4DC6 for ; Fri, 28 Aug 2015 16:03:02 +0000 (UTC) (envelope-from timp87@gmail.com) Received: from mail-wi0-x233.google.com (mail-wi0-x233.google.com [IPv6:2a00:1450:400c:c05::233]) (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 43C3F37F; Fri, 28 Aug 2015 16:03:02 +0000 (UTC) (envelope-from timp87@gmail.com) Received: by wiae7 with SMTP id e7so1099908wia.0; Fri, 28 Aug 2015 09:03:00 -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=Qaye0ePtzvY+2hNft3o9yQxlvW/Ux+W0bTrr+oaXQfY=; b=mn/GsROwpeF9WnY7B7DPuOyNofvAtpBMXxNRS+tCgeppDBAB87D5XJZbyJlXHyicNB T0USS5n9S0WwsPGoCSj+V2Sj+z2VkOJD/x1iskkMnOKDcep8+ZESEAcDWtu/N4jQwebv escCss0bAHzsk8oVAWw716OwOmjv9Zx0PPMMsA90aFVBPRJ67Ez5MHbbUZUv1KlgcWu/ FJgPPQdL50hgMDlw3hkDtSoR7dIR8PTn1LUVZzQbexmFydEFKbG/X4i/yuu4/AEwd7GO HKJPN+uKV93hZAjEtwQZSwvBHwv6yJOxiiAY7iarxDrQsiG5Ofch37IQ2Mc6jhNC0oM6 2azQ== MIME-Version: 1.0 X-Received: by 10.180.19.102 with SMTP id d6mr5286939wie.86.1440777780744; Fri, 28 Aug 2015 09:03:00 -0700 (PDT) Received: by 10.28.9.195 with HTTP; Fri, 28 Aug 2015 09:03:00 -0700 (PDT) Received: by 10.28.9.195 with HTTP; Fri, 28 Aug 2015 09:03:00 -0700 (PDT) In-Reply-To: References: <55DF261C.80009@freebsd.org> <20150827200534.GH16003@e-new.0x20.net> Date: Fri, 28 Aug 2015 19:03:00 +0300 Message-ID: Subject: Re: How to control and setup service? From: Pavel Timofeev To: Lars Engels Cc: freebsd-hackers@freebsd.org, Devin Teske , Allan Jude Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.20 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:03:02 -0000 One more idea is to have a key that would delete from rc config file any 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. 28 =D0=B0=D0=B2=D0=B3. 2015 =D0=B3. 11:58 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0= =BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C "Pavel Timofeev" =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB: > 2015-08-27 23:05 GMT+03:00 Lars Engels : > > On Thu, Aug 27, 2015 at 11:00:44AM -0400, Allan Jude wrote: > >> On 2015-08-27 09:21, Pavel Timofeev wrote: > >> > IMO such tools would be useful even for ansible/puppet and friends. > >> > Not just for users ;) > >> > > >> > >> Teaching service to use sysrc might be useful. Making sysrc detect tha= t > >> /etc/rc.conf.d/ exists, and use it, else fallback to > >> /etc/rc.conf might also be nice. > >> > >> service mysql-server enable|disable > >> sets mysql_enable=3D"YES|NO" > >> service mysql-server set datadir=3D/var/db/mysql > >> sets mysql_datadir=3D"/var/db/mysql" > > > > There's already a patch in phabricator: > > > > https://reviews.freebsd.org/D451 > > Great! > The supported features and syntax should be discussed more. > For example, it can't set rcopts, just print them, as I can see. > And I disagree with bapt@ and bdrewery@. > IMO default place should be /etc/rc.conf. This behaviour could be > controlled by some key. You already introduced '-s' key there. I like > it! > Finally, If a $service rcopts are already set in some file, this tool > should use that file to supplement them. >