From owner-freebsd-hackers@freebsd.org Thu Sep 3 14:59: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 2D19F99E016 for ; Thu, 3 Sep 2015 14:59:41 +0000 (UTC) (envelope-from timp87@gmail.com) Received: from mail-wi0-x235.google.com (mail-wi0-x235.google.com [IPv6:2a00:1450:400c:c05::235]) (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 BD9B0812; Thu, 3 Sep 2015 14:59:40 +0000 (UTC) (envelope-from timp87@gmail.com) Received: by wicfx3 with SMTP id fx3so55438236wic.0; Thu, 03 Sep 2015 07:59:39 -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=Aet5GMF58KQ1+FDbhLzsmm8WkzoKliC+3rhIkAXuCXI=; b=mcq/fN8AyOZCK51Z4bl/O0mg2yihxqR6dVT30tipCnBL+zlMIGjB/AByAVT4slMBFr U9sPdvPQYIF9LvBXvNbrdI7rNetxVF6pxJViOEvAnbiuvWJOM8z0+7icg/Ke04ADFMLL EYbh+YL5cl5AgcjfZQUNh4yIyqIfXZ6OV8mTVQzRgM6vhH+rblHmPEA/Pny3k0617CMI dh/QsDm5X5b+MziTRgOPuZRc+Il7lCjaSrbSFbsmesQ6wKSLws6IZ/x1PE/TlA0y3gqB hY0RrZ02yxVawZTpAUCST636bNW+e+vfzIBxiLkCwTeJL4pI2eU5o1uQom8J1YhLONWt C/Wg== MIME-Version: 1.0 X-Received: by 10.180.149.146 with SMTP id ua18mr15274210wib.86.1441292379152; Thu, 03 Sep 2015 07:59:39 -0700 (PDT) Received: by 10.28.9.195 with HTTP; Thu, 3 Sep 2015 07:59:39 -0700 (PDT) In-Reply-To: References: Date: Thu, 3 Sep 2015 17:59:39 +0300 Message-ID: Subject: Re: How to control and setup service? From: Pavel Timofeev To: Devin Teske Cc: freebsd-hackers@freebsd.org, Devin Teske 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: Thu, 03 Sep 2015 14:59:41 -0000 2015-09-03 0:03 GMT+03:00 Devin Teske : > > On Aug 27, 2015, at 6:21 AM, Pavel Timofeev wrote: > > [snip] > > there is no way to ask FreeBSD for a complete list of startup dirs. > > > Aside from the way you mentioned (snipped), there=E2=80=99s the following= : > # echo /etc/rc.d $( sysrc -n local_startup ) > > > [snip] > > > But, FreeBSD has more places with higher precedence than /etc/rc.conf! > It's /etc/rc.conf.local file, > then /etc/rc.conf.d/$service file, > > then /etc/rc.conf.d/$service/* files. > > Then even /usr/local/etc/rc.conf.d/$service files and subdirs which > appeared in FreeBSD 10! > > > D=E2=80=99Oh, didn=E2=80=99t realize that rc.conf.d/$name could be a dire= ctory. > Looks like I=E2=80=99ll have to update the following: > > https://reviews.freebsd.org/D3551 > sysrc: Add support for ``rc.conf.d'' service(8) configuration file(s) > > > And there is no way to ask FreeBSD "Hey! Where is your config files to > control services?=E2=80=9D. > > > I am adding that in the above review (D3551). Usage: > > # sysrc -l > /etc/rc.conf /etc/rc.conf.local > > # sysrc -ls ipfw > /etc/rc.conf /etc/rc.conf.local /etc/rc.conf.d/ipfw > /usr/local/etc/rc.conf.d/ipfw > > # sysrc -ls dhclient > /etc/rc.conf /etc/rc.conf.local /etc/rc.conf.d/dhclient > /usr/local/etc/rc.conf.d/dhclient /etc/rc.conf.d/network > /usr/local/etc/rc.conf.d/network > > > [snip] > > Of course, there is no way to ask "Where this service is enabled/disabled= ?=E2=80=9D > > > Currently today, there is: > # sysrc -F sshd_enable > sshd_enable: /etc/rc.conf > > > So we can catch $rc_conf_files, but not a bunch of rc.conf.d dirs and > subdirs. > > > With the above review (D3551): > # sysrc -Fs ipfw ipfw_enable > ipfw_enable: /etc/rc.conf.d/ipfw > > > [snip] > > We have only sysrc(8), but it can > > only edit $rc_conf_files in safe way. There is no support for > rc.conf.d dirs in sysrc(8). > > > https://reviews.freebsd.org/D3551 Thanks a lot, Devin! > > > And, in general, it's a tool to just `edit` $rc_conf_files, not to > control and configure services. > > > As mentioned previously (by Lars): > https://reviews.freebsd.org/D451 > It doesn't take into consideration a lot of things now :( > > [snip rest] > =E2=80=94 > Cheers, > Devin >