From owner-svn-src-head@FreeBSD.ORG Wed Dec 19 22:07:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B822285D; Wed, 19 Dec 2012 22:07:39 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [IPv6:2001:470:1:117::25]) by mx1.freebsd.org (Postfix) with ESMTP id 8CE0B8FC0C; Wed, 19 Dec 2012 22:07:39 +0000 (UTC) Received: from epsilon.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 44DF42269F; Wed, 19 Dec 2012 14:07:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1355954859; bh=7iOAbT4OTctHHOGNiBDQJ8kIqzUvIzZUY79Ik8u4qnE=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=5fZSq3eTdXhhBJjePcmGl0tJWKvV6TOmvd8abUN/DoNkUVeHq5aQK7CqDHtuHBp9o G/YBpxBERz1my5lKEZULMC/7+SGpvly5r5GnzZtGAj6Ot4CoxIRGaIgeDbb83UvGUp Ap2GR3fVb/A1cejHQLbtp9ycLdRN8MIwLqTBLEf8= Message-ID: <50D23AAA.9070804@delphij.net> Date: Wed, 19 Dec 2012 14:07:38 -0800 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Garrett Cooper Subject: Re: svn commit: r244198 - in head: etc/rc.d sbin/sysctl References: <201212132332.qBDNWmK4037503@svn.freebsd.org> <50D1D720.80206@FreeBSD.org> <1355931456.1198.203.camel@revolution.hippie.lan> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, Xin LI , svn-src-head@freebsd.org, Andrey Zonov , Chris Rees X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Dec 2012 22:07:39 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 12/19/12 13:08, Garrett Cooper wrote: > On Wed, Dec 19, 2012 at 12:14 PM, Chris Rees > wrote: >> >> On 19 Dec 2012 19:37, "Garrett Cooper" >> wrote: >>> >>> On Wed, Dec 19, 2012 at 7:37 AM, Ian Lepore >>> wrote: >>> >>> ... >>> >>>> Instead of running sysctl a bunch of times, how about >>>> something conceptually similar to >>>> >>>> cat /etc/sysctl.d/* /etc/sysctl.conf | sysctl -f - >>>> >>>> Along with this (untested) patch to make sysctl understand >>>> "-f -". >>>> >>>> Hmmm, is /dev/stdin available as early as sysctl.conf runs? >>>> If not, the attached patch isn't going to work. >>> >>> Why not just make sysctl understand multiple -f options? >>> You're probably going to run into more problems parsing from >>> /dev/stdin and it's going to obfuscate things a lot dealing >>> with which file came last, feeding back diagnostic info, etc. >>> Please don't "linuxise" this tool. >> >> I seem to recall cpio being around a lot before Linux... Our sh >> also accepts piped scripts. It's useful. > > Yes, but it just compresses data and doesn't have to necessarily > backtrack in order to do so. > >> ssh host cat file | sysctl -f - > > I prefer: > > ssh host cat file > foo sysctl -f foo > > ... and my bikesheds navy blue. Vulnerable to temporary file attacks (which is relatively easy to mitigate with mkstemp, though) and poor error handling. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- iQEcBAEBCAAGBQJQ0jqqAAoJEG80Jeu8UPuzBiMH/3EF1cDUcjpa9+k7OAPmJx89 PGQhy64QH5CZiztTFMpHsywaAJSr/5LeR/28SdP4YRB67P4IeSLFgRsB+6XqmCJz cwtuYmZKiorjUhZ9jojwuYG+tab/dRFit46oqk5FujVE8FPhvvBcDpwVyX5vXfsX HHUyks49pjx/pTFGldb6BxZ9Gp9OZyNXgAM5/RLAW/NLYMEksSp2z4YUquYIZYeh 8ZWsdpQKLFRXv3XG1pnpNYinoKjJ5Khxi6J10yrrOnBdUE1d0VBbMb5BdrBui65I bQVBTNPnoIQEYP2HtLybL5nnpwvX23ujLDQOxOA6/HtEUz6+206s9JHjRTTWOnc= =+9Qv -----END PGP SIGNATURE-----