From owner-freebsd-arch@FreeBSD.ORG Sun Sep 14 22:41:01 2014 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 36BA32FA; Sun, 14 Sep 2014 22:41:01 +0000 (UTC) Received: from mho-02-ewr.mailhop.org (mho-02-ewr.mailhop.org [204.13.248.72]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0B565F80; Sun, 14 Sep 2014 22:41:00 +0000 (UTC) Received: from [73.34.117.227] (helo=ilsoft.org) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1XTITW-0001o8-CB; Sun, 14 Sep 2014 22:40:54 +0000 Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by ilsoft.org (8.14.9/8.14.9) with ESMTP id s8EMerlO004035; Sun, 14 Sep 2014 16:40:53 -0600 (MDT) (envelope-from ian@FreeBSD.org) X-Mail-Handler: Dyn Standard SMTP by Dyn X-Originating-IP: 73.34.117.227 X-Report-Abuse-To: abuse@dyndns.com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information) X-MHO-User: U2FsdGVkX185+TvIyCk3Vru20NDbvbul X-Authentication-Warning: paranoia.hippie.lan: Host revolution.hippie.lan [172.22.42.240] claimed to be [172.22.42.240] Subject: Re: Trouble with freebsd rc system. From: Ian Lepore To: Alfred Perlstein In-Reply-To: <54161633.60207@freebsd.org> References: <54161633.60207@freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Sun, 14 Sep 2014 16:40:53 -0600 Message-ID: <1410734453.66615.2.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: arch@freebsd.org 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:41:01 -0000 On Sun, 2014-09-14 at 15:26 -0700, Alfred Perlstein wrote: > 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 A bit further down in run_rc_command, in the start) case, is: check_startmsgs && echo "Starting ${name}." and that output is controlled with rc_startmsgs=yes, which is the default. -- Ian