From nobody@FreeBSD.org  Thu Dec 20 16:36:01 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id BCAD3839
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 20 Dec 2012 16:36:01 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id A45B18FC0A
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 20 Dec 2012 16:36:01 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id qBKGa1Q4082715
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 20 Dec 2012 16:36:01 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id qBKGa1ZH082714;
	Thu, 20 Dec 2012 16:36:01 GMT
	(envelope-from nobody)
Message-Id: <201212201636.qBKGa1ZH082714@red.freebsd.org>
Date: Thu, 20 Dec 2012 16:36:01 GMT
From: Olivier Smedts <olivier@gid0.org>
To: freebsd-gnats-submit@FreeBSD.org
Subject: /etc/rc.d/sysctl : unknown oid 'XXX'
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         174595
>Category:       conf
>Synopsis:       /etc/rc.d/sysctl : unknown oid 'XXX' [regression]
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    jilles
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 20 16:40:00 UTC 2012
>Closed-Date:    Fri Mar 22 20:14:04 UTC 2013
>Last-Modified:  Fri Mar 22 20:20:00 UTC 2013
>Originator:     Olivier Smedts
>Release:        10-CURRENT
>Organization:
>Environment:
FreeBSD zozo.afpicl.lan 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r244488: Thu Dec 20 15:21:07 CET 2012     root@zozo.afpicl.lan:/usr/obj/usr/src/sys/CORE  amd64
>Description:
Since the last commit (r244198) to /usr/src/etc/rc.d/sysctl, I've got this error at startup just after root is mounted :

sysctl: unknown oid 'compat.linux.osrelease' at line 22: No such file or directory

This is somewhat expected, because the linux compat kmod is only loaded after that by /etc/rc.d/abi (because of linux_enable="YES" in /etc/rc.conf, which is a common use case).

The problem is that... there was no error before. I think the problem comes from the rewritten /usr/src/etc/rc.d/sysctl, which used ">/dev/null 2>&1" to avoid startup errors from being displayed.
>How-To-Repeat:
# echo 'compat.linux.osrelease=2.6.32' >> /etc/sysctl.conf
# echo 'linux_enable="YES"' >> /etc/rc.conf
# sed -i '' 's/^linux_load=/#linux_load=/' /boot/loader.conf
# shutdown -r now
>Fix:
Add "2>&1" after "> /dev/null" in /usr/src/etc/rc.d/sysctl

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-amd64->freebsd-rc 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Dec 24 08:58:08 UTC 2012 
Responsible-Changed-Why:  
reclassify. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174595 

From: Xin Li <delphij@delphij.net>
To: bug-followup@FreeBSD.org, olivier@gid0.org
Cc:  
Subject: Re: conf/174595: /etc/rc.d/sysctl : unknown oid &#39;XXX&#39; [regression]
Date: Mon, 24 Dec 2012 14:17:27 -0800

 -----BEGIN PGP SIGNED MESSAGE-----
 Hash: SHA256
 
 It seems that the old behavior is actually wrong...  How are we
 benefited by not being told about fatal errors?
 
 Cheers,
 - -- 
 Xin LI <delphij@delphij.net>    https://www.delphij.net/
 FreeBSD - The Power to Serve!           Live free or die
 -----BEGIN PGP SIGNATURE-----
 
 iQEcBAEBCAAGBQJQ2NR3AAoJEG80Jeu8UPuzniUH/0WqlPNwNRhyk1EosRKsVQyU
 0x3O9AKRHh1k7qlvCkqSr3tFjMnJ+DVLKL9AfkgPweZj7mQ2q8G3BPZTzYlNWFts
 aqiZ0o+Ua5F6FVx992yaCPS8Lbwkfmab/ia2HlrowJJmiLdjwu6rOisTnCTPbbvw
 NbLKzja72nrYFQ5ibub5zFoCP0lwJwSV2m6mhOyG+G07LXY4OZTdPuaBrJ3zCqt2
 Pd8AV9jmxsTn5e5jj1w3hJRhShQ1mgSeknYNBvbOFwQE2q4I+UVUr6ulmD624y57
 9ID1RHXB8SBbGGyLwaTShSMsSOE1e1wSPNBO2pJzwHSeYw6rMNjo5izrL4GCDhM=
 =gVdi
 -----END PGP SIGNATURE-----

From: Olivier Smedts <olivier@gid0.org>
To: d@delphij.net
Cc: bug-followup@freebsd.org
Subject: Re: conf/174595: /etc/rc.d/sysctl : unknown oid &#39;XXX&#39; [regression]
Date: Tue, 15 Jan 2013 12:16:12 +0100

 In the compat.linux.osrelease case it's not a fatal error, it seems
 that sysctl manages to set the correct value after the linux kld is
 loaded by linux_enable="YES", even if it failed the first time.
 
 % sysctl compat.linux.osrelease
 compat.linux.osrelease: 2.6.32
 
 I don't really know why and which mechanism is responsible of this but
 it behaves like "late" mounts.
 
 
 2012/12/24 Xin Li <delphij@delphij.net>:
 > -----BEGIN PGP SIGNED MESSAGE-----
 > Hash: SHA256
 >
 > It seems that the old behavior is actually wrong...  How are we
 > benefited by not being told about fatal errors?
 >
 > Cheers,
 > - --
 > Xin LI <delphij@delphij.net>    https://www.delphij.net/
 > FreeBSD - The Power to Serve!           Live free or die
 > -----BEGIN PGP SIGNATURE-----
 >
 > iQEcBAEBCAAGBQJQ2NR3AAoJEG80Jeu8UPuzniUH/0WqlPNwNRhyk1EosRKsVQyU
 > 0x3O9AKRHh1k7qlvCkqSr3tFjMnJ+DVLKL9AfkgPweZj7mQ2q8G3BPZTzYlNWFts
 > aqiZ0o+Ua5F6FVx992yaCPS8Lbwkfmab/ia2HlrowJJmiLdjwu6rOisTnCTPbbvw
 > NbLKzja72nrYFQ5ibub5zFoCP0lwJwSV2m6mhOyG+G07LXY4OZTdPuaBrJ3zCqt2
 > Pd8AV9jmxsTn5e5jj1w3hJRhShQ1mgSeknYNBvbOFwQE2q4I+UVUr6ulmD624y57
 > 9ID1RHXB8SBbGGyLwaTShSMsSOE1e1wSPNBO2pJzwHSeYw6rMNjo5izrL4GCDhM=
 > =gVdi
 > -----END PGP SIGNATURE-----
 
 
 
 -- 
 Olivier Smedts                                                 _
                                         ASCII ribbon campaign ( )
 e-mail: olivier@gid0.org        - against HTML email & vCards  X
 www: http://www.gid0.org    - against proprietary attachments / \
 
   "Il y a seulement 10 sortes de gens dans le monde :
   ceux qui comprennent le binaire,
   et ceux qui ne le comprennent pas."

From: Olivier Smedts <olivier@gid0.org>
To: bug-followup@FreeBSD.org, olivier@gid0.org
Cc: delphij@freebsd.org
Subject: Re: conf/174595: /etc/rc.d/sysctl : unknown oid &#39;XXX&#39; [regression]
Date: Wed, 13 Mar 2013 10:11:08 +0100

 --047d7b3438ae5a592b04d7cac93f
 Content-Type: text/plain; charset=ISO-8859-1
 
 Hi,
 
 Isn't the logic inverted between the start/reload case and the lastload case ?
 
 The attached patch seems logical :
 - tell sysctl to ignore unknown OIDs during the "start" case (corrects
 the regression)
 rationale : some klds still aren't loaded at start, my example with
 linux_enable="YES" in rc.conf and compat.linux.osrelease=2.6.32 in
 sysctl.conf is a common use case, and it's not meaningful / it's
 confusing to show a startup error about a sysctl which couldn't be set
 while it actually has been set in lastload stage
 - tell sysctl to not ignore unknown OIDs during the "lastload" case
 (preserve added value of r244198)
 rationale : if an OID is really unknown and couldn't be set neither in
 the start nor in the lastload cases, it's useful to be told about the
 fatal error
 - behave in the "reload" case like in the "lastload" stage
 rationale : reloads usually happen after system startup so they're
 really a "lastlastload", and it's useful to spit out errors about
 unknown OIDs to the operator who asked for a reload
 
 Hoping the attachment won't be stripped,
 Olivier
 
 -- 
 Olivier Smedts                                                 _
                                         ASCII ribbon campaign ( )
 e-mail: olivier@gid0.org        - against HTML email & vCards  X
 www: http://www.gid0.org    - against proprietary attachments / \
 
   "Il y a seulement 10 sortes de gens dans le monde :
   ceux qui comprennent le binaire,
   et ceux qui ne le comprennent pas."
 
 --047d7b3438ae5a592b04d7cac93f
 Content-Type: text/plain; charset=US-ASCII; name="patch.txt"
 Content-Disposition: attachment; filename="patch.txt"
 Content-Transfer-Encoding: base64
 X-Attachment-Id: f_he890foi0
 
 LS0tIC91c3Ivc3JjL2V0Yy9yYy5kL3N5c2N0bAkyMDEyLTEyLTE4IDE1OjA3OjEwLjgzMjk2NzU0
 MyArMDEwMAorKysgL2V0Yy9yYy5kL3N5c2N0bAkyMDEzLTAzLTEzIDA5OjQ5OjQwLjYzMDk4MTc0
 NCArMDEwMApAQCAtMTEsNyArMTEsNyBAQAogY29tbWFuZD0iL3NiaW4vc3lzY3RsIgogc3RvcF9j
 bWQ9IjoiCiBzdGFydF9jbWQ9InN5c2N0bF9zdGFydCIKLXJlbG9hZF9jbWQ9InN5c2N0bF9zdGFy
 dCIKK3JlbG9hZF9jbWQ9InN5c2N0bF9zdGFydCBsYXN0IgogbGFzdGxvYWRfY21kPSJzeXNjdGxf
 c3RhcnQgbGFzdCIKIGV4dHJhX2NvbW1hbmRzPSJyZWxvYWQgbGFzdGxvYWQiCiAKQEAgLTE5LDEw
 ICsxOSwxMCBAQAogewogCWNhc2UgJDEgaW4KIAlsYXN0KQotCQljb21tYW5kX2FyZ3M9Ii1pIC1m
 IgorCQljb21tYW5kX2FyZ3M9Ii1mIgogCTs7CiAJKikKLQkJY29tbWFuZF9hcmdzPSItZiIKKwkJ
 Y29tbWFuZF9hcmdzPSItaSAtZiIKIAk7OwogCWVzYWMKIAo=
 --047d7b3438ae5a592b04d7cac93f--
State-Changed-From-To: open->closed 
State-Changed-By: jilles 
State-Changed-When: Fri Mar 22 20:12:46 UTC 2013 
State-Changed-Why:  
Fixed in head in r248620, thanks. 
This bug does not exist in older branches. 


Responsible-Changed-From-To: freebsd-rc->jilles 
Responsible-Changed-By: jilles 
Responsible-Changed-When: Fri Mar 22 20:12:46 UTC 2013 
Responsible-Changed-Why:  
Track followups. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=174595 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: conf/174595: commit references a PR
Date: Fri, 22 Mar 2013 20:12:33 +0000 (UTC)

 Author: jilles
 Date: Fri Mar 22 20:12:25 2013
 New Revision: 248620
 URL: http://svnweb.freebsd.org/changeset/base/248620
 
 Log:
   rc.d/sysctl: Fix error messages about unknown OIDs.
   
   There are three situations where the sysctl script is called:
   1. "start", very early
   2. "lastload", near the end of rc
   3. "reload", at admin request while the system is booted
   
   Ignore unknown OIDs in situation 1 because kernel modules may not be loaded
   yet and complain about them in situations 2 and 3.
   
   PR:		conf/174595
   Submitted by:	Olivier Smedts
 
 Modified:
   head/etc/rc.d/sysctl
 
 Modified: head/etc/rc.d/sysctl
 ==============================================================================
 --- head/etc/rc.d/sysctl	Fri Mar 22 17:55:38 2013	(r248619)
 +++ head/etc/rc.d/sysctl	Fri Mar 22 20:12:25 2013	(r248620)
 @@ -11,7 +11,7 @@ name="sysctl"
  command="/sbin/sysctl"
  stop_cmd=":"
  start_cmd="sysctl_start"
 -reload_cmd="sysctl_start"
 +reload_cmd="sysctl_start last"
  lastload_cmd="sysctl_start last"
  extra_commands="reload lastload"
  
 @@ -19,10 +19,10 @@ sysctl_start()
  {
  	case $1 in
  	last)
 -		command_args="-i -f"
 +		command_args="-f"
  	;;
  	*)
 -		command_args="-f"
 +		command_args="-i -f"
  	;;
  	esac
  
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
