From ayuzhaninov@openstat.ru  Thu Nov  8 12:33:16 2012
Return-Path: <ayuzhaninov@openstat.ru>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id AF44BABC
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  8 Nov 2012 12:33:16 +0000 (UTC)
	(envelope-from ayuzhaninov@openstat.ru)
Received: from mail.openstat.ru (mail.openstat.ru [193.169.234.252])
	by mx1.freebsd.org (Postfix) with ESMTP id 5B0598FC1B
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  8 Nov 2012 12:33:15 +0000 (UTC)
Received: from citrin.office.vega.ru ([10.100.124.49])
	by mail.openstat.ru with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256)
	(Exim 4.80.1 (FreeBSD))
	(envelope-from <ayuzhaninov@openstat.ru>)
	id 1TWRIG-000GJj-Cb
	for FreeBSD-gnats-submit@freebsd.org; Thu, 08 Nov 2012 16:33:13 +0400
Received: by citrin.office.vega.ru (sSMTP sendmail emulation); Thu, 08 Nov 2012 16:33:12 +0400
Message-Id: <E1TWRIG-000GJj-Cb@mail.openstat.ru>
Date: Thu, 08 Nov 2012 16:33:12 +0400
From: "Anton Yuzhaninov" <ayuzhaninov@openstat.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] can't set sysctls from /etc/sysctl.conf for OIDs created by loadable modules
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         173471
>Category:       conf
>Synopsis:       [patch] can't set sysctls from /etc/sysctl.conf for OIDs created by loadable modules
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 08 12:40:01 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Anton Yuzhaninov
>Release:        FreeBSD 10.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD citrin.office.vega.ru 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r241615: Tue Oct 23 17:20:03 MSK 2012 root@citrin.office.vega.ru:/usr/obj/usr/src/sys/NK i386

>Description:
Some sysctl OID is created only after loading kernel module, where the defined.

E. g. net.inet.ip.dummynet.* sysctls can be set only after dummynet module is loaded.

>How-To-Repeat:

Add to /etc/rc.conf
kld_list="ipfw dummynet"

Add to /etc/sysctl.conf
net.inet.ip.dummynet.io_fast=1

After reboot this sysctl will no be set.

>Fix:

To fix 'REQUIRE: kld' should be added to /etc/rc.d/sysctl
But this creates circular dependency, which can be resolved by removing
'REQUIRE: sysctl' from /etc/rc.d/hostid
It seems to be /etc/rc.d/hostid don't not depend on /etc/sysctl.conf settings.

--- patch begins here ---
Index: etc/rc.d/hostid
===================================================================
--- etc/rc.d/hostid	(revision 241615)
+++ etc/rc.d/hostid	(working copy)
@@ -28,7 +28,6 @@
 #
 
 # PROVIDE: hostid
-# REQUIRE: sysctl
 # KEYWORD: nojail
 
 . /etc/rc.subr
Index: etc/rc.d/sysctl
===================================================================
--- etc/rc.d/sysctl	(revision 241615)
+++ etc/rc.d/sysctl	(working copy)
@@ -4,6 +4,7 @@
 #
 
 # PROVIDE: sysctl
+# REQUIRE: kld
 
 . /etc/rc.subr
 
--- patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
