From owner-freebsd-hackers@freebsd.org Wed Sep 2 21:03:05 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 E07159C9921 for ; Wed, 2 Sep 2015 21:03:04 +0000 (UTC) (envelope-from dteske@panzura.com) Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com [IPv6:2607:f8b0:400e:c03::230]) (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 AA0F7AF8 for ; Wed, 2 Sep 2015 21:03:04 +0000 (UTC) (envelope-from dteske@panzura.com) Received: by pacex6 with SMTP id ex6so17711580pac.0 for ; Wed, 02 Sep 2015 14:03:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=panzura.com; s=google; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to; bh=rq737iSBixQtiWNYB4wrv4IgHXYwxgTinueet9b5Mq8=; b=f01yPf/FUfKM8G+m6S+787WALuLcLznGsbyVxGL/jB0KzGU4y25NLXIIgI19b70IlP VG53hr6ySQ0wuGXSvm5Ycnq6Un7iVEm7ZSTZWM1ZFUqb9JA4RdXY0gUvIs25zk4yKvl7 nXJQufRYkvxGt3U9/hjUQvf6X3vX8fFkYqPr8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:message-id:references:to; bh=rq737iSBixQtiWNYB4wrv4IgHXYwxgTinueet9b5Mq8=; b=ElU5/MBMK+TuNTyriCoorzOVo3kaksv4AKtnG2+fCMhLdXF4i2h4EDK2JxK3Nw5AD/ iyE/NOIrSGYocxo+m71osmSJNUHihz1GWD1F3H2CPIIJHsacZNH8mSNSmRojFq3oau5d 6rTuBnVBqu6sTzzI+DcbDOo2F+mwXJ8tgE7Ex0A06mJfdE+sQaTvREKwla224liFiLVQ zU55c88BwKFpL02t8BIFVM4mNpzLGSnf7vHHCE8NewJuuwf5x7EST4N1BmhKJuxdo59R DxPiJsRZjJWU7ROGupmw1XsBrEN3kugCGzlnOIunXL8n1X5+/egF98fn01Evvq+YjzBi dD/A== X-Gm-Message-State: ALoCoQlJPjorpRvignHOpZzp2eNdsZQKveZ/IIzw2kBGGkbfZVfB3v8Qa2hv9OzFpcOCx52rMHFS X-Received: by 10.66.62.163 with SMTP id z3mr59593803par.12.1441227784102; Wed, 02 Sep 2015 14:03:04 -0700 (PDT) Received: from tinkerbell.pixel8networks.com ([12.179.176.146]) by smtp.gmail.com with ESMTPSA id q5sm22712613pdc.65.2015.09.02.14.03.02 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 02 Sep 2015 14:03:03 -0700 (PDT) Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\)) Subject: Re: How to control and setup service? From: Devin Teske In-Reply-To: Date: Wed, 2 Sep 2015 14:03:07 -0700 Cc: freebsd-hackers@freebsd.org, Devin Teske Message-Id: References: To: Pavel Timofeev X-Mailer: Apple Mail (2.2102) X-Mailman-Approved-At: Wed, 02 Sep 2015 21:38:42 +0000 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: Wed, 02 Sep 2015 21:03:05 -0000 > On Aug 27, 2015, at 6:21 AM, Pavel Timofeev wrote: >=20 [snip] > there is no way to ask FreeBSD for a complete list of startup dirs. >=20 Aside from the way you mentioned (snipped), there=E2=80=99s the = following: # echo /etc/rc.d $( sysrc -n local_startup ) [snip] >=20 > 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! >=20 D=E2=80=99Oh, didn=E2=80=99t realize that rc.conf.d/$name could be a = directory. 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 > And, in general, it's a tool to just `edit` $rc_conf_files, not to > control and configure services. >=20 As mentioned previously (by Lars): https://reviews.freebsd.org/D451 [snip rest] =E2=80=94=20 Cheers, Devin