From owner-freebsd-bugs@FreeBSD.ORG Tue Jan 8 17:00:00 2013 Return-Path: Delivered-To: freebsd-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CD16DDB2 for ; Tue, 8 Jan 2013 17:00:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 9CF3AD65 for ; Tue, 8 Jan 2013 17:00:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.6/8.14.6) with ESMTP id r08H003a015917 for ; Tue, 8 Jan 2013 17:00:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.6/8.14.6/Submit) id r08H00BT015916; Tue, 8 Jan 2013 17:00:00 GMT (envelope-from gnats) Resent-Date: Tue, 8 Jan 2013 17:00:00 GMT Resent-Message-Id: <201301081700.r08H00BT015916@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, jb Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7F3B0A93 for ; Tue, 8 Jan 2013 16:57:02 +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 706EAD32 for ; Tue, 8 Jan 2013 16:57:02 +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 r08Gv2r5090392 for ; Tue, 8 Jan 2013 16:57:02 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id r08Gv2ok090391; Tue, 8 Jan 2013 16:57:02 GMT (envelope-from nobody) Message-Id: <201301081657.r08Gv2ok090391@red.freebsd.org> Date: Tue, 8 Jan 2013 16:57:02 GMT From: jb To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: bin/175139: bsdinstall(8) - do not offer services invalid in installation env (e.g. VirtualBox) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jan 2013 17:00:00 -0000 >Number: 175139 >Category: bin >Synopsis: bsdinstall(8) - do not offer services invalid in installation env (e.g. VirtualBox) >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: Tue Jan 08 17:00:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: jb >Release: FreeBSD 9.1-RELEASE #0 r243826 >Organization: >Environment: FreeBSD 9.1-RELEASE #0 r243826 ... i386 >Description: This applies to any installation env (VirtualBox, other hardware platforms). On VirtualBox, I selected powerd service during install, but at boot time there was an error msg: starting powerd powerd lookup freq: No such file or directory /etc/rc: WARNING failed to start powerd Disabling powerd in /etc/rc.conf to get rid of the error message is a fix, but not a solution to a problem. Making a statement that in VirtualBox powerd doesn't work because the guest OS can not control the frequency of the host CPU is true, but is not a solution as well. The solution is to NOT offer bugus/invalid services for installation env, real or virtual. Bsdinstall can discover this condition with checking for lack of sysctl -a | grep dev.cpu.0.freq sysctl -a | grep dev.cpu.0.freq_levels in /usr/libexec/bsdinstall/services, exactly as it does (in powerd.c) with if (sysctlnametomib("dev.cpu.0.freq", freq_mib, &len)) err(1, "lookup freq"); ... if (sysctlnametomib("dev.cpu.0.freq_levels", levels_mib, &len)) err(1, "lookup freq_levels"); in /usr/sbin/powerd (via /etc/rc.d/powerd). Bsdinstall already does similar checks for other features, see: $ grep -ir sysctl /usr/libexec/bsdinstall/ >How-To-Repeat: as above >Fix: >Release-Note: >Audit-Trail: >Unformatted: