From owner-freebsd-stable@FreeBSD.ORG Thu Feb 28 07:45:12 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 61597E7; Thu, 28 Feb 2013 07:45:12 +0000 (UTC) (envelope-from andrnils@gmail.com) Received: from mail-we0-x231.google.com (mail-we0-x231.google.com [IPv6:2a00:1450:400c:c03::231]) by mx1.freebsd.org (Postfix) with ESMTP id CA46E1017; Thu, 28 Feb 2013 07:45:11 +0000 (UTC) Received: by mail-we0-f177.google.com with SMTP id d7so1253369wer.22 for ; Wed, 27 Feb 2013 23:45:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=CNRkn/IcgJb97t+vkbqGfhkrB+qC7RQ3B8SG/mRBJh0=; b=QQV18sG2Prd/rIKqgYHqMNuDGlQFxXq2i2wMJMUI45Tz9pgAG6URt10Myv1oMljwaP M/PzSiW0YlsN53wklVsLo0qKTxC7YEs4eQKxMIrQ5L1B+GBehz3Y11PNGm/CpyHWWEJ0 db0WlqkklK9eZ6zogfeppre8gqeVgIQoZyzmVA6cpVpqYVG5nuAoofL4z/1mV9Yd9YuK wyxh2PMhbQdks7K7nV+qovmPGvs6nfbUPa9CKk5LpkRzL3XOrNrQxkfeS5WkfLM7GS9E aC2CEG1gjQyO+Rrypd0pH9BmYPuHwUH4fwtvGSTKQuMvwBAJQM3tUoRenA6x8jswgNJl 0K/g== MIME-Version: 1.0 X-Received: by 10.194.81.40 with SMTP id w8mr8903219wjx.14.1362037511090; Wed, 27 Feb 2013 23:45:11 -0800 (PST) Received: by 10.194.13.230 with HTTP; Wed, 27 Feb 2013 23:45:11 -0800 (PST) In-Reply-To: References: Date: Thu, 28 Feb 2013 08:45:11 +0100 Message-ID: Subject: Re: rc.d/sysctl fails to parse sysctl.conf From: Andreas Nilsson To: Chris Rees Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: FreeBSD Stable Mailing List X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Feb 2013 07:45:12 -0000 On Wed, Feb 27, 2013 at 10:39 PM, Chris Rees wrote: > On 27 February 2013 21:19, Andreas Nilsson wrote: > > Hello, > > > > I tried to get my sound working, and long story short: rc.d/sysctl parses > > sysctl.conf wrongly if there are sysctls of the form > > > > mib=val1=val2 > > > > which is what you need for sound. For reference I needed/wanted > > > > dev.hdaa.4.nid25_config=as=1,seq=15 > > dev.hdaa.4.nid31_config=as=1 > > > > I believe the following patch would address the incorrect parsing: > > > > --- /etc/rc.d/sysctl.old 2013-02-27 22:00:00.000000000 +0100 > > +++ /etc/rc.d/sysctl 2013-02-27 22:05:24.000000000 +0100 > > @@ -26,7 +26,7 @@ > > \#*|'') > > ;; > > *) > > - mib=${var%=*} > > + mib=${var%%=*} > > val=${var#*=} > > > > if current_value=`${SYSCTL} -n ${mib} > > 2>/dev/null`; then > > I think that this is the right thing to do here. > > Chris > As a follow-up question: is sysctl.conf supposed to handle all valid input one can give sysctl on the command line? Using the above example would normally be typed: sysctl dev.hdaa.4.nid25_config="as=1 seq=15" which works, but fails to work from sysctl.conf Best regards Andreas