From owner-freebsd-bugs Sat Oct 19 15: 0: 8 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2AE0D37B401 for ; Sat, 19 Oct 2002 15:00:06 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 93C7343E88 for ; Sat, 19 Oct 2002 15:00:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9JM04x3054165 for ; Sat, 19 Oct 2002 15:00:04 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9JM04Uo054164; Sat, 19 Oct 2002 15:00:04 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BAB8637B401 for ; Sat, 19 Oct 2002 14:53:03 -0700 (PDT) Received: from guardian.sch.ru (TCH-MSU.ATM6-0.181.M9-R1.msu.net [212.16.0.250]) by mx1.FreeBSD.org (Postfix) with ESMTP id 56DAF43E91 for ; Sat, 19 Oct 2002 14:52:57 -0700 (PDT) (envelope-from mokr@amber.mokr.ru) Received: from amber.mokr.ru ([172.16.0.6]) by guardian.sch.ru (8.12.6/8.12.6/20021009101427) with ESMTP id g9JLqteA045028 for ; Sun, 20 Oct 2002 01:52:55 +0400 (MSD) (envelope-from mokr@amber.mokr.ru) Received: from amber.mokr.ru (localhost [127.0.0.1]) by amber.mokr.ru (8.12.6/8.12.6/020822) with ESMTP id g9JLqNCA000900 for ; Sun, 20 Oct 2002 01:52:54 +0400 (MSD) (envelope-from mokr@amber.mokr.ru) Received: (from mokr@localhost) by amber.mokr.ru (8.12.6/8.12.6/Submit) id g9JLqMQj000899; Sun, 20 Oct 2002 01:52:22 +0400 (MSD) Message-Id: <200210192152.g9JLqMQj000899@amber.mokr.ru> Date: Sun, 20 Oct 2002 01:52:22 +0400 (MSD) From: Sergey Mokryshev Reply-To: Sergey Mokryshev To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: conf/44282: /etc/rc.d/sysctl script works incorrectly in case of non-existent MIB Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 44282 >Category: conf >Synopsis: /etc/rc.d/sysctl script works incorrectly in case of non-existent MIB >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: Sat Oct 19 15:00:03 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Sergey Mokryshev >Release: FreeBSD 5.0-CURRENT i386 >Organization: Tersys >Environment: System: FreeBSD amber.mokr.net 5.0-CURRENT FreeBSD 5.0-CURRENT #12: Sun Oct 20 00:40:36 MSD 2002 su@amber.mokr.net:/.1/a/obj/.1/a/src/sys/AMBER_UP i386 >Description: /sbin/sysctl does not return anything printable upon request (sysctl -n ${mib}) of a non-existent variable, just an error-code. The code in 'elif' clause in /etc/rc.d/sysctl elif [ "$1" -eq "last" ]; then warn "sysctl ${mib} does not exits." fi is probably wrong >How-To-Repeat: Put a non-existent variable in /etc/sysctl.conf and reboot. There will be message like (taken from /var/log/console.log) Oct 20 00:22:44 amber kernel: [: : bad number >Fix: --- /tmp/sysctl.orig Sun Oct 20 01:08:03 2002 +++ sysctl Sun Oct 20 01:23:04 2002 @@ -49,7 +49,7 @@ sysctl ${var} ;; esac - elif [ "$1" -eq "last" ]; then + elif [ "$?" -ne "0" ]; then warn "sysctl ${mib} does not exits." fi ;; >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message