From owner-freebsd-rc@FreeBSD.ORG Sun Feb 26 21:30:12 2006 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BCEAA16A420 for ; Sun, 26 Feb 2006 21:30:12 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: from mail2.fluidhosting.com (mx21.fluidhosting.com [204.14.89.4]) by mx1.FreeBSD.org (Postfix) with SMTP id 0A63243D58 for ; Sun, 26 Feb 2006 21:30:11 +0000 (GMT) (envelope-from dougb@FreeBSD.org) Received: (qmail 55614 invoked by uid 399); 26 Feb 2006 21:30:11 -0000 Received: from localhost (HELO ?192.168.1.100?) (dougb@dougbarton.us@127.0.0.1) by localhost with SMTP; 26 Feb 2006 21:30:11 -0000 Message-ID: <44021DE2.2010509@FreeBSD.org> Date: Sun, 26 Feb 2006 13:30:10 -0800 From: Doug Barton Organization: http://www.FreeBSD.org/ User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: Tobias Roth References: <20060221023750.GA32185@odin.ac.hmc.edu> <20060221045324.8717645048@ptavv.es.net> <20060221075140.GA9101@droopy.unibe.ch> <20060221212818.GA22713@odin.ac.hmc.edu> <20060225132226.GA27397@droopy.unibe.ch> In-Reply-To: <20060225132226.GA27397@droopy.unibe.ch> X-Enigmail-Version: 0.94.0.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@freebsd.org Subject: Re: dhclient existing when run early in startup X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Feb 2006 21:30:12 -0000 Tobias Roth wrote: > On Tue, Feb 21, 2006 at 01:28:18PM -0800, Brooks Davis wrote: > >>> Possible improvements: >>> 1) change dhclient to accept a timeout on the commandline >> This would be a useful addon. Actually, I'd like to see both the option >> to specify a shorter one and the option to keep trying forever since >> that's what's wanted in some scenerios. > > I've implemented the two switches -i and -t, that override the variables > from dhclient.conf 'retry' and 'timeout'. The patch can be found here: > > http://fsck.ch/dhclient_timeouts.diff While you're at it, how about making the number of tries a runtime option as well? I'm speaking specifically about the number of times dhclient tries an interface before giving up with 'no link'. I have locally patched my system to reduce that number from 10 to 5 since on my laptop bge0 is always tried first, and rarely is it actually connected. Doug -- This .signature sanitized for your protection From owner-freebsd-rc@FreeBSD.ORG Mon Feb 27 00:57:26 2006 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9AA8E16A420 for ; Mon, 27 Feb 2006 00:57:26 +0000 (GMT) (envelope-from alex@foxybanana.com) Received: from letra.reed.edu (letra.reed.edu [134.10.2.35]) by mx1.FreeBSD.org (Postfix) with ESMTP id 46D8343D48 for ; Mon, 27 Feb 2006 00:57:26 +0000 (GMT) (envelope-from alex@foxybanana.com) Received: from [134.10.29.217] (c029h217.dorm.reed.edu [134.10.29.217]) (authenticated bits=0) by letra.reed.edu (8.12.10/8.12.10) with ESMTP id k1R0vPSM006337 for ; Sun, 26 Feb 2006 16:57:25 -0800 (PST) Message-ID: <44024E6A.3060001@foxybanana.com> Date: Sun, 26 Feb 2006 16:57:14 -0800 From: Alexander Botero-Lowry User-Agent: Thunderbird 1.5 (X11/20051201) MIME-Version: 1.0 To: freebsd-rc@freebsd.org Content-Type: multipart/mixed; boundary="------------070109070708080802060008" Subject: chkconfig X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2006 00:57:26 -0000 This is a multi-part message in MIME format. --------------070109070708080802060008 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hi there. A while ago I largely rewrote sbin/chkconfig from NetBSD (not installed by default because it's broken) to work and to be a little more usable in general. While formally chkconfig(8) from netbsd would only read state from /etc/rc.conf.d my chkconfig will read state from any location that rc.subr can read from. (using checkyesno). My chkconfig still writes state to /etc/rc.conf.d/. It was developed with FreeBSD support in consideration (as I mostly run FreeBSD these days), but has never really under gone any testing, in part do to some issues in abi/clearvar/cleantmp which were recently fixed. It does not use grep, or sed ,or awk, or any other tools from /usr (on netbsd it was in /sbin, so i thought it shouldn't use anything in /usr). The chkconfig(8) in netbsd cvs uses grep. I've attached it for anyone interested and would love to get some feedback (even the bad kind). I'm curious if it's feasible to include it in the base system as well. --------------070109070708080802060008 Content-Type: text/plain; name="varname.sh" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="varname.sh" #!/bin/sh # # Copyright 2005-2006, Alexander Botero-Lowry # # Original copyright and license: # # Copyright (c) 2001 Zembu Labs, Inc. # All rights reserved. # # Author: Dan Mercer # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # 2. Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # 3. All advertising materials mentioning features or use of this software # must display the following acknowledgement: # This product includes software developed by Alexander Botero-Lowry # 4. The name of the author may not be used to endorse or promote products # derived from this software without specific prior written permission # # THIS SOFTWARE IS PROVIDED BY ZEMBU LABS, INC. ``AS IS'' AND ANY EXPRESS # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WAR- # RANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIS- # CLAIMED. IN NO EVENT SHALL ZEMBU LABS BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT # NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # display() and the service list are products of chkconfig.sh. # chkconfig.sh falls under the following copyright. # # This product includes software developed by Zembu Labs, Inc. # # TODO: # Implement sort by state # Find a cleaner way to change state # # $Id: varname.sh,v 1.8 2005/08/18 07:08:18 alex Exp $ # . /etc/rc.subr # # display() # $1 = path to rc script # $2 = verbose # # Gives a basic summar of services, if $2 is defined then no # text is given, only a return code. # display() { load_rc_config $1 run_rc_script $1 rcvar | while read -r line; do case $line in \$*=*) var1=${line#$} var2=${var1%%=*} if checkyesno $var2; then if [ -z $2 ]; then printf "\t%-16s\t\ton\n" ${var2%_enable} fi return 0 else if [ -z $2 ]; then printf "\t%-16s\t\toff\n" ${var2%_enable} fi return 1 fi ;; esac done } # # This function is unused, but in theory would be a good foundation for # a function to sort by state. One would have to create two lists of # services, on and off, and then display them in order. # # This method is rather ineffient. # display_by_state() { load_rc_config $1 run_rc_script $1 rcvar | while read -r line; do case $line in \$*=*) var1=${line#$} var2=${var1%%=*} if checkyesno $var2; then if [ -z $2 ]; then printf "\t%-16s\t\ton\n" ${var2%_enable} fi return 0 else if [ -z $2 ]; then printf "\t%-16s\t\toff\n" ${var2%_enable} fi return 1 fi ;; esac done } # # change_state() # $1 = rc.d script # $2 = state # # changes the state of a service from on to off. # change_state() { filename=$1 state=$2 if [ "$USER" != "root" ]; then echo "ERROR: Root privelages are required to change the state of an rc \ script" exit 1 fi if [ -z $force ]; then echo "A state file does not exist. Use -f to create a state file." exit 1 fi if [ ! -d /etc/rc.conf.d ]; then mkdir /etc/rc.conf.d fi if [ "$state" = "on" ]; then mode="YES" else mode="NO" fi load_rc_config /etc/rc.d/$filename # ## FIXME: the vailidty of this on freebsd is questionable at best # run_rc_script /etc/rc.d/$filename rcvar | while read -r line; do case $line in \$*=*) var1=${line#$} var2=${var1%%=*} echo "${var2}=$mode">/etc/rc.conf.d/$filename ;; esac done } # # is_valid_option() # $1 = option # # Determins whether the option passed as $1 is a valid option with # which to change state. # is_valid_option() { if [ "$1" = "on" ]; then return 0 elif [ "$1" = "off" ]; then return 0 else return 1 fi } # # is_valid_name() # $1 = rc script # # Determins whether the given rc script is a valid rc.d script # does this by use of checking for rc.subr # # This is not optimal # is_valid_name() { if [ ! -f /etc/rc.d/$1 ]; then return 1 fi cat /etc/rc.d/$1 | while read -r line; do case $line in ". /etc/rc.subr") echo 0 ;; esac done } # ## FIXME: sort_by_state is broken # if [ "$1" = "-s" ]; then sort_by_state=1 shift elif [ "$1" = "-f" ]; then force=1 shift fi if [ -z $1 ] ; then printf "\tService\t\t\t\tState\n" printf "\t=======\t\t\t\t=====\n" rc_order_path="/etc/rc.d/*" elif [ "`is_valid_name $1`" = "0" ] && [ -z $2 ]; then rc_order_path="/etc/rc.d/$1" verbose=no elif [ "`is_valid_name $1`" = "0" ] && `is_valid_option $2`; then change_state $1 $2 elif [ "`is_valid_name $1`" = "0" ] && ! `is_valid_option $2`; then echo "Valid options are on or off." else echo "The rc script: $1 is not a valid rc.d script." exit 1 fi for rc in `/sbin/rcorder -s nostart $rc_order_path 2>/dev/null`; do if [ "`is_valid_name ${rc#/etc/rc.d/}`" = "0" ]; then display $rc $verbose fi done --------------070109070708080802060008-- From owner-freebsd-rc@FreeBSD.ORG Mon Feb 27 07:52:32 2006 Return-Path: X-Original-To: freebsd-rc@hub.freebsd.org Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C49C816A420; Mon, 27 Feb 2006 07:52:32 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id CC15B43D4C; Mon, 27 Feb 2006 07:52:30 +0000 (GMT) (envelope-from glebius@FreeBSD.org) Received: from freefall.freebsd.org (glebius@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k1R7qU0V034494; Mon, 27 Feb 2006 07:52:30 GMT (envelope-from glebius@freefall.freebsd.org) Received: (from glebius@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k1R7qUF1034490; Mon, 27 Feb 2006 07:52:30 GMT (envelope-from glebius) Date: Mon, 27 Feb 2006 07:52:30 GMT From: Gleb Smirnoff Message-Id: <200602270752.k1R7qUF1034490@freefall.freebsd.org> To: glebius@FreeBSD.org, freebsd-rc@FreeBSD.org, freebsd-net@FreeBSD.org Cc: Subject: Re: bin/93727: [ifconfig] polling parameter in ifconfig statement of rc.conf not handled correctly X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2006 07:52:32 -0000 Old Synopsis: polling parameter in ifconfig statement of rc.conf not handled correctly New Synopsis: [ifconfig] polling parameter in ifconfig statement of rc.conf not handled correctly Responsible-Changed-From-To: freebsd-rc->freebsd-net Responsible-Changed-By: glebius Responsible-Changed-When: Mon Feb 27 07:51:59 UTC 2006 Responsible-Changed-Why: Bug in ifconfig(8), not in rc. http://www.freebsd.org/cgi/query-pr.cgi?pr=93727 From owner-freebsd-rc@FreeBSD.ORG Mon Feb 27 11:02:54 2006 Return-Path: X-Original-To: freebsd-rc@freebsd.org Delivered-To: freebsd-rc@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5952B16A431 for ; Mon, 27 Feb 2006 11:02:54 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 17B7843D92 for ; Mon, 27 Feb 2006 11:02:42 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k1RB2gHd047144 for ; Mon, 27 Feb 2006 11:02:42 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k1RB2fPk047138 for freebsd-rc@freebsd.org; Mon, 27 Feb 2006 11:02:41 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 27 Feb 2006 11:02:41 GMT Message-Id: <200602271102.k1RB2fPk047138@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Cc: Subject: Current problem reports assigned to you X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Feb 2006 11:02:54 -0000 Current FreeBSD problem reports Critical problems Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2005/02/10] conf/77340 rc awk used in /etc/rc.d/nsswitch when not a o [2006/02/13] conf/93287 rc [patch] Make rc.subr jail-aware 2 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2002/11/12] conf/45226 rc Fix for rc.network, ppp-user annoyance o [2004/11/13] conf/73909 rc [patch] rc.d/sshd does not work with port o [2005/02/18] conf/77663 rc Suggestion: add /etc/rc.d/addnetswap afte o [2005/03/16] conf/78906 rc [patch] Allow mixer_enable="NO" in rc.con o [2005/05/14] kern/81006 rc ipnat not working with tunnel interfaces o [2005/06/28] conf/82738 rc [patch] add amd_program line to defaults/ o [2005/08/27] conf/85363 rc syntax error in /etc/rc.d/devfs o [2005/11/13] conf/88913 rc [patch] wrapper support for rc.subr o [2005/11/14] conf/88974 rc autoconfigured vlans confuse rc.d/netif o [2005/12/03] conf/89870 rc [patch] feature request to make netif ver o [2006/01/30] conf/92523 rc [patch] allow rc scripts to kill process o [2006/02/25] conf/93815 rc [patch] Adds in the ability to save ipfw 12 problems total.