From owner-cvs-ports@FreeBSD.ORG Tue Feb 2 00:52:50 2010 Return-Path: Delivered-To: cvs-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E37D9106566B; Tue, 2 Feb 2010 00:52:49 +0000 (UTC) (envelope-from am@raisa.eu.org) Received: from raisa.eu.org (raisa.eu.org [83.17.178.202]) by mx1.freebsd.org (Postfix) with ESMTP id 4225F8FC0C; Tue, 2 Feb 2010 00:52:49 +0000 (UTC) Received: from bolt.zol (62-121-98-25.home.aster.pl [62.121.98.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by raisa.eu.org (Postfix) with ESMTP id 48BD7735; Tue, 2 Feb 2010 01:21:31 +0100 (CET) Content-Type: text/plain; charset=utf-8; format=flowed; delsp=yes To: "Doug Barton" References: <201002011745.o11HjVaY099715@repoman.freebsd.org> <4B674B1C.8040203@FreeBSD.org> Date: Tue, 02 Feb 2010 01:19:17 +0100 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: "Emil Smolenski" Message-ID: In-Reply-To: <4B674B1C.8040203@FreeBSD.org> User-Agent: Opera Mail/10.10 (FreeBSD) Cc: cvs-ports@freebsd.org, "Philip M. Gollucci" , Boris Kovalenko , cvs-all@freebsd.org, ports-committers@freebsd.org Subject: Re: cvs commit: ports/net/quagga Makefile ports/net/quagga/files quagga.sh.in X-BeenThere: cvs-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Feb 2010 00:52:50 -0000 On Mon, 01 Feb 2010 22:43:56 +0100, Doug Barton wrote: >> pgollucci 2010-02-01 17:45:31 UTC Philip, Boris, thanks for your work! Doug, thanks for your review of my little change and the rest of the rc script. > There is a better way to accomplish what this change does which I > included in the attached patch. I think it isn't better way. Return value is OK, but commands aren't called for all daemons. Your script halts on first error but I think for example stopping already stopped daemon shouldn't prevent another daemon from being stopped. Let's assume following configuration: # grep quagga /etc/rc.conf quagga_daemons="zebra ripd ripngd ospfd bgpd" # cd /usr/local/etc/rc.d/ ./quagga.am -- my rc script ./quagga.dougb -- Doug's rc script Consider following scenarios: Scenario #1 (ripngd stopped) We want to know which daemons are running # ./quagga.dougb onestatus zebra is running as pid 74504. ripd is running as pid 74352. ripngd is not running. but... # ./quagga.am onestatus zebra is running as pid 74504. ripd is running as pid 74352. ripngd is not running. ospfd is running as pid 74386. bgpd is running as pid 74402. Scenario #2 (zebra and ospfd stopped) Something is wrong. Let's check: # ./quagga.dougb onestatus zebra is not running. Ok, my quagga is turned off. Let's turn it on: # ./quagga.dougb onestart Starting zebra. ripd already running? (pid=74352). Confusing, but OK -- one process is started, another was already started -- my quagga is now started. but... # ./quagga.am onestatus zebra is running as pid 74950. ripd is running as pid 74352. ripngd is running as pid 74901. ospfd is not running. bgpd is running as pid 74402. # pkill zebra # ./quagga.am onestatus zebra is not running. ripd is running as pid 74352. ripngd is running as pid 74901. ospfd is not running. bgpd is running as pid 74402. # ./quagga.am onestart Starting zebra. ripd already running? (pid=74352). ripngd already running? (pid=74901). Starting ospfd. bgpd already running? (pid=74402). Scenario #3 (zebra stopped) OK, I don't want to play with quagga anymore. Stop it: # ./quagga.dougb onestop zebra not running? (check /var/run/quagga/zebra.pid). Uff! But... # ./quagga.am onestatus zebra is not running. ripd is running as pid 75192. ripngd is running as pid 74901. ospfd is running as pid 75080. bgpd is running as pid 74402. # ./quagga.am onestop zebra not running? (check /var/run/quagga/zebra.pid). Stopping ripd. Stopping ripngd. Stopping ospfd. Stopping bgpd. Etc, etc... > Regarding the other changes: > > 1. (Hopefully) improve readability for the comments > 2. Add quagga_extralibs_path to the comments, some description should be > included there instead of "blah blah." :) The reason for this is that > the default empty variable assignments have been removed (they are > neither necessary nor desirable). > 3. The construction "while true; do" is usually safe, but better to use > the shell internal way of saying the same thing. > 4. Make $daemon in do_cmd local I think rest of the changes are appropriate. -- am