From owner-freebsd-arch@FreeBSD.ORG Sun Sep 14 22:26:22 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0B8CAE78 for ; Sun, 14 Sep 2014 22:26:22 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id EB3B1E7F for ; Sun, 14 Sep 2014 22:26:21 +0000 (UTC) Received: from AlfredMacbookAir.local (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id 48CC7346DE1B for ; Sun, 14 Sep 2014 15:26:21 -0700 (PDT) Message-ID: <54161633.60207@freebsd.org> Date: Sun, 14 Sep 2014 15:26:59 -0700 From: Alfred Perlstein Organization: FreeBSD User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: arch@freebsd.org Subject: Trouble with freebsd rc system. Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 14 Sep 2014 22:26:22 -0000 Hey folks, We are building an appliance based on FreeBSD. One of the issues we have is that during development we need to know which rc script we are in during boot so that if something is hanging or otherwise misbehaving we know which script it is. I am contemplating this hack to /etc/rc.subr's run_rc_command() method: run_rc_command() { _return=0 rc_arg=$1 if [ -z "$name" ]; then err 3 'run_rc_command: $name is not set.' fi # Don't repeat the first argument when passing additional command- # line arguments to the command subroutines. # shift 1 rc_extra_args="$*" echo "===> $name $rc_arg" As you can see I've added the call to echo so we know where we are. This is somewhat suboptimal because we really only want that output during startup. So a few questions: 1. Is there a way to know we are booting when inside of /etc/rc.subr:run_rc_command() ? 2. Is there a magic thing I'm missing that does what I want (output which /etc/rc.d/ script I am about to run)? 3. How would I make a knob to turn off the "echo" so that I can contribute this back to FreeBSD without getting into a bikeshed on bootup messages. Kindly please advise. -Alfred