From owner-svn-src-head@FreeBSD.ORG Wed Dec 19 21:08:27 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 6D4F534E; Wed, 19 Dec 2012 21:08:27 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-la0-f41.google.com (mail-la0-f41.google.com [209.85.215.41]) by mx1.freebsd.org (Postfix) with ESMTP id 9BBE08FC13; Wed, 19 Dec 2012 21:08:25 +0000 (UTC) Received: by mail-la0-f41.google.com with SMTP id m15so1892677lah.28 for ; Wed, 19 Dec 2012 13:08:24 -0800 (PST) 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=83saUwzJ3TFp9U1HpFFeBsHfJ1i4WUaH7TDhBKhUP3U=; b=V7SiCoPz2ElazrBcGTaeiWsRrqJKVEbRnW52EYYQpCS54jeayfjellaRijdf8wupkV 0WeRbiV/dbzVkoz15oaLZZOp8LrU/+wqhxjiZWmISfu5VgI5kKIwVfHjmlXuIwUiOKeh kuaSbB4KuuyfeextryaoU3vI4YKRNrQhuvmYdbbT92ir8Dyx0IEkEmBszrJrlK6RbPYd uS1lB/tXTPsyhTfB79DG6EBT+L+w2MEm6bKp8ybtCeOO1PZ6nNvLVgk9ssx5U91RDJyd frTcBRv9sURYQLXPdZ6ca8mOFRuivDjhxMcKc1IYke4Ew7Fivic3JQ8M9QE17eFvuGMP eWWQ== MIME-Version: 1.0 Received: by 10.152.106.212 with SMTP id gw20mr6665683lab.8.1355951304285; Wed, 19 Dec 2012 13:08:24 -0800 (PST) Received: by 10.112.99.70 with HTTP; Wed, 19 Dec 2012 13:08:24 -0800 (PST) In-Reply-To: References: <201212132332.qBDNWmK4037503@svn.freebsd.org> <50D1D720.80206@FreeBSD.org> <1355931456.1198.203.camel@revolution.hippie.lan> Date: Wed, 19 Dec 2012 13:08:24 -0800 Message-ID: Subject: Re: svn commit: r244198 - in head: etc/rc.d sbin/sysctl From: Garrett Cooper To: Chris Rees Content-Type: text/plain; charset=ISO-8859-1 Cc: Ian Lepore , src-committers@freebsd.org, svn-src-all@freebsd.org, Xin LI , svn-src-head@freebsd.org, Andrey Zonov X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list 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 21:08:27 -0000 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. Point is that Ian is potentially solving the problem incorrectly (his concern is over I/O latency when booting up on slower platforms). Unless he has measurements and tests to support doing this, it really doesn't make sense to morph sysctl from the stripped down sh "interpreter" that it is today into something that have to handle some of the other error conditions and input permutations that hexdump/od deals with (which his beforementioned patch doesn't do, neither did the patch/commit that hrs/delphij posted) as real files are grossly different from character devices and stdio file descriptors. I would have less qualms if the support came directly from NetBSD as there would have been some traction on it, but the problem is that the proposal will a) make sysctl slower and bigger (I know more than a handful of scripts that execute sysctl _a lot_, so the faster it is at loading the image into memory and executing the better), and b) will make sysctl diverge further from the other BSDs (which means less testing, more code janitor work later on, have to deal with backport issues, etc). Traditional Unix philosophy is construction of simple commands with a particular, well-defined purpose. Some of the suggestions made here doing #file, etc are going in a very Linux centric direction by making sysctl into a custom swiss army knife that does 20 different things instead of [again] solving what the root issue is in Ian's case: making his system boot faster. Thanks, -Garrett