From owner-freebsd-rc@FreeBSD.ORG Mon Apr 26 08:21:26 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B81D106566B for ; Mon, 26 Apr 2010 08:21:26 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta08.emeryville.ca.mail.comcast.net (qmta08.emeryville.ca.mail.comcast.net [76.96.30.80]) by mx1.freebsd.org (Postfix) with ESMTP id 466598FC08 for ; Mon, 26 Apr 2010 08:21:26 +0000 (UTC) Received: from omta17.emeryville.ca.mail.comcast.net ([76.96.30.73]) by qmta08.emeryville.ca.mail.comcast.net with comcast id A86v1e0011afHeLA888HJc; Mon, 26 Apr 2010 08:08:17 +0000 Received: from koitsu.dyndns.org ([98.248.46.159]) by omta17.emeryville.ca.mail.comcast.net with comcast id A88G1e0033S48mS8d88Gvy; Mon, 26 Apr 2010 08:08:16 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 2A7749B425; Mon, 26 Apr 2010 01:08:15 -0700 (PDT) Date: Mon, 26 Apr 2010 01:08:15 -0700 From: Jeremy Chadwick To: freebsd-rc@freebsd.org Message-ID: <20100426080815.GA41938@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-net@freebsd.org Subject: rc(8) script -- waiting for the network to become usable 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, 26 Apr 2010 08:21:26 -0000 Foremost, sorry for the cross-post, but more eyes in this case means overall more discussion. Secondly, please keep me CC'd as I'm not on either -rc or -net. I recently proposed addition of a new script to the rc framework which verifies (using ping) that layer 3 network connectivity is up/functional before continuing on with daemons which require network access: http://lists.freebsd.org/pipermail/freebsd-stable/2010-April/056400.html The overall response was positive, with full acknowledgement that this is indeed a hack -- yet necessary -- and that something more appropriate could probably be introduced into the base system to provide a much cleaner solution (launchd was mentioned). I'd like folks (particularly on -rc) to chime in here, and please see about adding this to the base system. Please note there's one typo in the script (a line which needs to be commented out) in my original post which I've since fixed in the version that's available via HTTP. Thank you! -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | From owner-freebsd-rc@FreeBSD.ORG Mon Apr 26 09:18:44 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01D00106564A for ; Mon, 26 Apr 2010 09:18:44 +0000 (UTC) (envelope-from mad@madpilot.net) Received: from megatron.madpilot.net (megatron.madpilot.net [88.149.173.206]) by mx1.freebsd.org (Postfix) with ESMTP id 4B5EA8FC1E for ; Mon, 26 Apr 2010 09:18:43 +0000 (UTC) Received: from megatron.madpilot.net (localhost [127.0.0.1]) by megatron.madpilot.net (Postfix) with ESMTP id 283431856; Mon, 26 Apr 2010 10:59:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=madpilot.net; h= user-agent:in-reply-to:content-disposition:content-type :content-type:mime-version:references:message-id:subject:subject :from:from:date:date:received:received; s=mail; t=1272272388; x= 1274086788; bh=s2dqmsmP4aSwQFMGDx+dw/2/fpHSNH5+u7gnpii9kiI=; b=V 8WQI/YkCztRqdVGmvHlE768EoeEiW0uouVsw0pufswCehLtU9zMgvBgl+FJeo6xO eGybRVmGmT4A2pgEMq5Oifru3b77J0Z9Swn7UKSwTB98CdI7O1bfSP3tvAdHxqcO 3LQ/oDeXSlUQXgQiFBp+kz27662ZSRQEbivtp+MXtA= X-Virus-Scanned: amavisd-new at madpilot.net Received: from megatron.madpilot.net ([127.0.0.1]) by megatron.madpilot.net (megatron.madpilot.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 0vFvJYKG5yRU; Mon, 26 Apr 2010 10:59:48 +0200 (CEST) Received: by megatron.madpilot.net (Postfix, from userid 1000) id 42D971850; Mon, 26 Apr 2010 10:59:48 +0200 (CEST) Date: Mon, 26 Apr 2010 10:59:48 +0200 From: Guido Falsi To: Jeremy Chadwick Message-ID: <20100426085947.GB20779@megatron.madpilot.net> References: <20100426080815.GA41938@icarus.home.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100426080815.GA41938@icarus.home.lan> X-Operating-System: FreeBSD 8.0-STABLE User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-net@freebsd.org, freebsd-rc@freebsd.org Subject: Re: rc(8) script -- waiting for the network to become usable 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, 26 Apr 2010 09:18:44 -0000 On Mon, Apr 26, 2010 at 01:08:15AM -0700, Jeremy Chadwick wrote: > Foremost, sorry for the cross-post, but more eyes in this case means > overall more discussion. Secondly, please keep me CC'd as I'm not on > either -rc or -net. > > I recently proposed addition of a new script to the rc framework which > verifies (using ping) that layer 3 network connectivity is up/functional > before continuing on with daemons which require network access: > > http://lists.freebsd.org/pipermail/freebsd-stable/2010-April/056400.html > > The overall response was positive, with full acknowledgement that this > is indeed a hack -- yet necessary -- and that something more appropriate > could probably be introduced into the base system to provide a much > cleaner solution (launchd was mentioned). I did read the original thread, and like the idea. I myself have servers winth ntpd failing to configure tiself at boot due to this problem and was thinking of some hack to force the behaviour you suggest. So I obviously like your idea and would like to see this in the base system. Regarding launchd, I don't know much about it, but I do like the rc system and having the boot sequence managed by scripts one can easily modify to taste. I'd rather not modify this system with some daemon performing obscure tasks based on some configuration file. The flexibility given by scripts is imho, quite superior to any configurable daemon's. This is just my opinion, obviously. As stated I don't know much about launchd, and it is quite possible that I have misconceptions about it, so please don't flame me if I insulted it! Thank you for your effort and work to bring this to the masses! -- Guido Falsi From owner-freebsd-rc@FreeBSD.ORG Mon Apr 26 11:07:09 2010 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 797671065673 for ; Mon, 26 Apr 2010 11:07:09 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 922C38FC21 for ; Mon, 26 Apr 2010 11:07:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o3QB78ME004258 for ; Mon, 26 Apr 2010 11:07:08 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o3QB7705004256 for freebsd-rc@FreeBSD.org; Mon, 26 Apr 2010 11:07:08 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 26 Apr 2010 11:07:08 GMT Message-Id: <201004261107.o3QB7705004256@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-rc@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-rc@FreeBSD.org 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, 26 Apr 2010 11:07:09 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o conf/145445 rc [rc.d] error in /etc/rc.d/jail (bad logic) o conf/145440 rc [rc.d] [patch] add multiple fib support (setfib) in /e o conf/145399 rc [patch] rc.d scripts are unable to start/stop programs o conf/145344 rc [patch] Fix kitchen sink approach for rc.d scripts ins o conf/145009 rc [patch] rc.subr(8): rc.conf should allow mac label con o conf/144213 rc [rc.d] [patch] Disappearing zvols on reboot o conf/143637 rc [patch] ntpdate(8) support for ntp-servers supplied by o conf/143085 rc [patch] ftp-proxy(8) rc(8) with multiple instances o conf/143084 rc [jail] [patch]: fix rc.d/jail creating stray softlinks o conf/142973 rc [jail] [patch] Strange counter init value in jail rc o conf/142434 rc [patch] Add cpuset(1) support to rc.subr(8) o conf/142304 rc rc.conf(5): mdconfig and mdconfig2 rc.d scripts lack e o conf/141909 rc rc.subr(8): [patch] add rc.conf.d support to /usr/loca o conf/141907 rc [rc.d] Bug if mtu (maybe others?) is set as first argu o conf/141678 rc [patch] A minor enhancement to how /etc/rc.d/jail dete o conf/141275 rc [request] dhclient(8) rc script should print something o conf/140440 rc [patch] allow local command files in rc.{suspend,resum o conf/140261 rc [patch] Improve flexibility of mdconfig2 startup scrip o conf/138208 rc [rc] [patch] Making rc.firewall (workstation) IPv6 awa o conf/137629 rc [rc] background_dhclient rc.conf option causing double o conf/137470 rc [PATCH] /etc/rc.d/mdconfig2 : prioritize cli parameter o conf/137271 rc [rc] Cannot update /etc/host.conf when root filesystem o conf/136875 rc [request] _flags appending o conf/136624 rc [rc.d] sysctl variables for ipnat are not applied on b o conf/135338 rc [rc.d] pf startup order seems broken [regression] o conf/134918 rc [patch] rc.subr fails to detect perl daemons o conf/134660 rc [patch] rc-script for initializing ng_netflow+ng_ipfw o conf/134333 rc PPP configuration problem in the rc.d scripts in combi o conf/134006 rc [patch] Unload console screensaver kernel modules if s o conf/133987 rc [rc.d] defaultroute broken with DHCP in some cases o conf/133890 rc [patch] sshd(8): add multiple profiles to the rc.d scr o conf/132483 rc rc.subr(8) [patch] setfib(1) support for rc.subr o conf/132476 rc [rc.d] [patch] add support setfib(1) in rc.d/routing o conf/128299 rc [patch] /etc/rc.d/geli does not mount partitions using o conf/127917 rc [patch] dumpon rejects on start with physmem>swap even o bin/126562 rc rcorder(8) fails to run unrelated startup scripts when o conf/126392 rc [patch] rc.conf ifconfig_xx keywords cannot be escaped p bin/126324 rc [patch] rc.d/tmp: Prevent mounting /tmp in second tim o conf/124747 rc [patch] savecore can't create dump from encrypted swap o conf/124248 rc [jail] [patch] add support for nice value for rc.d/jai o conf/123734 rc [patch] Chipset VIA CX700 requires extra initializatio o conf/123222 rc [patch] Add rtprio(1)/idprio(1) support to rc.subr(8). o conf/122477 rc [patch] /etc/rc.d/mdconfig and mdconfig2 are ignoring o conf/122170 rc [patch] [request] New feature: notify admin via page o o kern/121566 rc [nfs] [request] [patch] ethernet iface should be broug o conf/120431 rc [patch] devfs.rules are not initialized under certain o conf/120406 rc [devd] [patch] Handle newly attached pcm devices (eg. o conf/119874 rc [patch] "/etc/rc.d/pf reload" fails if there are macro o conf/119076 rc [patch] [rc.d] /etc/rc.d/netif tries to remove alias a o bin/118325 rc [patch] [request] new periodic script to test statuses o conf/118255 rc savecore never finding kernel core dumps (rcorder prob o conf/117935 rc [patch] ppp fails to start at boot because of missing o conf/113915 rc [patch] ndis wireless driver fails to associate when i o conf/109980 rc /etc/rc.d/netif restart doesn't destroy cloned_interfa o conf/109562 rc [rc.d] [patch] [request] Make rc.d/devfs usable from c o conf/108589 rc rtsol(8) fails due to default ipfw rules o conf/106009 rc [ppp] [patch] [request] Fix pppoed startup script to p o conf/105689 rc [ppp] [request] syslogd starts too late at boot o conf/105568 rc [patch] [request] Add more flexibility to rc.conf, to o conf/105145 rc [ppp] [patch] [request] add redial function to rc.d/pp o conf/104549 rc [patch] rc.d/nfsd needs special _find_processes functi o conf/102700 rc [geli] [patch] Add encrypted /tmp support to GELI/GBDE o conf/99721 rc [patch] /etc/rc.initdiskless problem copy dotfile in s o conf/99444 rc [patch] Enhancement: rc.subr could easily support star o conf/96343 rc [patch] rc.d order change to start inet6 before pf o conf/93815 rc [patch] Adds in the ability to save ipfw rules to rc.d o conf/92523 rc [patch] allow rc scripts to kill process after a timeo o conf/89870 rc [patch] [request] make netif verbose rc.conf toggle o conf/89061 rc [patch] IPv6 6to4 auto-configuration enhancement o conf/88913 rc [patch] wrapper support for rc.subr o conf/85819 rc [patch] script allowing multiuser mode in spite of fsc o kern/81006 rc ipnat not working with tunnel interfaces on startup o conf/77663 rc Suggestion: add /etc/rc.d/addnetswap after addcritremo o conf/73677 rc [patch] add support for powernow states to power_profi o conf/58939 rc [patch] dumb little hack for /etc/rc.firewall{,6} o conf/56934 rc [patch] rc.firewall rules for natd expect an interface o conf/45226 rc [patch] Fix for rc.network, ppp-user annoyance o conf/44170 rc [patch] Add ability to run multiple pppoed(8) on start 78 problems total. From owner-freebsd-rc@FreeBSD.ORG Mon Apr 26 16:26:21 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D71BC106564A for ; Mon, 26 Apr 2010 16:26:21 +0000 (UTC) (envelope-from julianelischer@gmail.com) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.157]) by mx1.freebsd.org (Postfix) with ESMTP id 5C2A08FC21 for ; Mon, 26 Apr 2010 16:26:21 +0000 (UTC) Received: by fg-out-1718.google.com with SMTP id 22so1724181fge.13 for ; Mon, 26 Apr 2010 09:26:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=fGtNmpOQsFfvi9j+H4y30D6cGTRtSe4/hRNVtoTt+pI=; b=uV6jAyBJG6BIcmqu2AeUvP4J8Sbo5lLvSBFKSuFxzZyPnFdUQO1XFmOGABMLICwhY1 xBecLHcDwjLiwoYDhgW2rzsnQKgirXfacG6YKgBDujzjNM15o34j+KOrxPVxrkvnJtMm VYf3eA+wkSf+FoflJRJ/vrdxew3N26F2vmiwo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=oTFbVbK9VpOz+zMkpZd2iGsD1/X6IMlE0tq/vQQO5RpuWZlBkpjrH33m5b3wyN27xV At7bu2e+C7aNBoe30Y1TIoJqpPdey26y6Toqq4e+761LbcvD5qGX9lB5+AqQ76ymILQn WYe94yDM1GKKpzpV1OW7B/nqAM+1TQxRaor38= Received: by 10.87.67.25 with SMTP id u25mr7754178fgk.32.1272297621478; Mon, 26 Apr 2010 09:00:21 -0700 (PDT) Received: from julian-mac.elischer.org (h-67-100-89-137.snfccasy.static.covad.net [67.100.89.137]) by mx.google.com with ESMTPS id e11sm4632160fga.18.2010.04.26.09.00.12 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 26 Apr 2010 09:00:13 -0700 (PDT) Sender: Julian Elischer Message-ID: <4BD5B887.9070203@elischer.org> Date: Mon, 26 Apr 2010 09:00:07 -0700 From: Julian Elischer User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10.4; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Jeremy Chadwick References: <20100426080815.GA41938@icarus.home.lan> In-Reply-To: <20100426080815.GA41938@icarus.home.lan> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, freebsd-rc@freebsd.org Subject: Re: rc(8) script -- waiting for the network to become usable 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, 26 Apr 2010 16:26:21 -0000 On 4/26/10 1:08 AM, Jeremy Chadwick wrote: > Foremost, sorry for the cross-post, but more eyes in this case means > overall more discussion. Secondly, please keep me CC'd as I'm not on > either -rc or -net. > > I recently proposed addition of a new script to the rc framework which > verifies (using ping) that layer 3 network connectivity is up/functional > before continuing on with daemons which require network access: a down side is that you can't boot if some OTHER machine is not up. > > http://lists.freebsd.org/pipermail/freebsd-stable/2010-April/056400.html > > The overall response was positive, with full acknowledgement that this > is indeed a hack -- yet necessary -- and that something more appropriate > could probably be introduced into the base system to provide a much > cleaner solution (launchd was mentioned). there does need to be some dependency tracking to do with networks. maybe there acn be a selection of ways to pass that milestone.. (carrier detect, ping, incoming packets non-0) etc. my favourite is: INPUT_PACKETS=`netstat -i | awk "/${IP}/"'{print $5}'` if [ -n "${INPUT_PACKETS}" -a "${INPUT_PACKETS}" != "0" ] them echo "It's UP!" fi > > I'd like folks (particularly on -rc) to chime in here, and please see > about adding this to the base system. > > Please note there's one typo in the script (a line which needs to be > commented out) in my original post which I've since fixed in the version > that's available via HTTP. > > Thank you! > From owner-freebsd-rc@FreeBSD.ORG Mon Apr 26 16:46:22 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 369F9106564A for ; Mon, 26 Apr 2010 16:46:22 +0000 (UTC) (envelope-from jdc@koitsu.dyndns.org) Received: from qmta09.emeryville.ca.mail.comcast.net (qmta09.emeryville.ca.mail.comcast.net [76.96.30.96]) by mx1.freebsd.org (Postfix) with ESMTP id 1D3EB8FC13 for ; Mon, 26 Apr 2010 16:46:21 +0000 (UTC) Received: from omta12.emeryville.ca.mail.comcast.net ([76.96.30.44]) by qmta09.emeryville.ca.mail.comcast.net with comcast id ACC01e00C0x6nqcA9GmNDE; Mon, 26 Apr 2010 16:46:22 +0000 Received: from koitsu.dyndns.org ([98.248.46.159]) by omta12.emeryville.ca.mail.comcast.net with comcast id AGmL1e0013S48mS8YGmMf9; Mon, 26 Apr 2010 16:46:22 +0000 Received: by icarus.home.lan (Postfix, from userid 1000) id 4FE519B425; Mon, 26 Apr 2010 09:46:18 -0700 (PDT) Date: Mon, 26 Apr 2010 09:46:18 -0700 From: Jeremy Chadwick To: Julian Elischer Message-ID: <20100426164618.GA55086@icarus.home.lan> References: <20100426080815.GA41938@icarus.home.lan> <4BD5B887.9070203@elischer.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BD5B887.9070203@elischer.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-net@freebsd.org, freebsd-rc@freebsd.org Subject: Re: rc(8) script -- waiting for the network to become usable 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, 26 Apr 2010 16:46:22 -0000 On Mon, Apr 26, 2010 at 09:00:07AM -0700, Julian Elischer wrote: > On 4/26/10 1:08 AM, Jeremy Chadwick wrote: > >Foremost, sorry for the cross-post, but more eyes in this case means > >overall more discussion. Secondly, please keep me CC'd as I'm not on > >either -rc or -net. > > > >I recently proposed addition of a new script to the rc framework which > >verifies (using ping) that layer 3 network connectivity is up/functional > >before continuing on with daemons which require network access: > > a down side is that you can't boot if some OTHER machine is not up. The boot-up process will still continue regardless if the ping check passed or failed. It just means that daemons/services attempting to use the network and *expect* connectivity to work may not function correctly (meaning: they'll behave just like they already do. ;-) ) I indirectly tried to cover the "if some other machine is not up" point in my initial post on -stable: "1) This script requires the $waitnetwork_ip box/router/whatever respond to ICMP ECHO requests. Please do not bikeshed on this point; we need something that works, and this requirement shouldn't be that bad to deal with (firewall/ACL-wise). For most folks (co-located in particular), this could be your default gateway, but you can use whatever you want." It would be possible to extend the script to loop through multiple IPs specified in $waitnetwork_ip (space-delimited); the first one to cause ping to exit with code 0 (ICMP ECHO reply seen) would therefore deem the network usable and continue on. > >http://lists.freebsd.org/pipermail/freebsd-stable/2010-April/056400.html > > > >The overall response was positive, with full acknowledgement that this > >is indeed a hack -- yet necessary -- and that something more appropriate > >could probably be introduced into the base system to provide a much > >cleaner solution (launchd was mentioned). > > there does need to be some dependency tracking to do with networks. > maybe there acn be a selection of ways to pass that milestone.. > > (carrier detect, ping, incoming packets non-0) etc. > my favourite is: > > INPUT_PACKETS=`netstat -i | awk "/${IP}/"'{print $5}'` > if [ -n "${INPUT_PACKETS}" -a "${INPUT_PACKETS}" != "0" ] > them > echo "It's UP!" > fi This isn't the same thing as doing a ping check though. As I understand it, netstat -i shows you how many Ethernet packets have been seen -- that includes ARP. The intended goal of the script is to verify that a usable network connection exists -- usable in this case means "whatever host you device in $waitnetwork_ip responds to ICMP". If this is an Internet host (e.g. 4.2.2.1), then said IP responding to ICMP would indicate Internet connectivity is available. I think most users would fall into the latter class, not the "I want to verify my LAN connectivity is up and working, except the other box on my LAN is powered off..." class. Basically what I'm saying is that I fully acknowledge there's no absolute 100% failsafe method that's going to work for every single user's environment. My script's goal isn't to address every single problem/scenario -- just the most common one, and one I (we?) server administrators deal with regularly. -- | Jeremy Chadwick jdc@parodius.com | | Parodius Networking http://www.parodius.com/ | | UNIX Systems Administrator Mountain View, CA, USA | | Making life hard for others since 1977. PGP: 4BD6C0CB | From owner-freebsd-rc@FreeBSD.ORG Tue Apr 27 16:59:11 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 333201065679; Tue, 27 Apr 2010 16:59:11 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id D86EC8FC18; Tue, 27 Apr 2010 16:59:10 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.3/8.14.3) with ESMTP id o3RGvsmo067520; Tue, 27 Apr 2010 11:57:54 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.3/8.14.3/Submit) id o3RGvsrP067519; Tue, 27 Apr 2010 11:57:54 -0500 (CDT) (envelope-from brooks) Date: Tue, 27 Apr 2010 11:57:54 -0500 From: Brooks Davis To: Jeremy Chadwick Message-ID: <20100427165753.GA58954@lor.one-eyed-alien.net> References: <20100426080815.GA41938@icarus.home.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d6Gm4EdcadzBjdND" Content-Disposition: inline In-Reply-To: <20100426080815.GA41938@icarus.home.lan> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (lor.one-eyed-alien.net [127.0.0.1]); Tue, 27 Apr 2010 11:57:55 -0500 (CDT) Cc: freebsd-net@freebsd.org, freebsd-rc@freebsd.org Subject: Re: rc(8) script -- waiting for the network to become usable 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: Tue, 27 Apr 2010 16:59:11 -0000 --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 26, 2010 at 01:08:15AM -0700, Jeremy Chadwick wrote: > Foremost, sorry for the cross-post, but more eyes in this case means > overall more discussion. Secondly, please keep me CC'd as I'm not on > either -rc or -net. >=20 > I recently proposed addition of a new script to the rc framework which > verifies (using ping) that layer 3 network connectivity is up/functional > before continuing on with daemons which require network access: >=20 > http://lists.freebsd.org/pipermail/freebsd-stable/2010-April/056400.html >=20 > The overall response was positive, with full acknowledgement that this > is indeed a hack -- yet necessary -- and that something more appropriate > could probably be introduced into the base system to provide a much > cleaner solution (launchd was mentioned). >=20 > I'd like folks (particularly on -rc) to chime in here, and please see > about adding this to the base system. Given that this would fix the problems many users see in the current world order and that it's relativly unintrusive I think it's an ok thing to add. -- Brooks --d6Gm4EdcadzBjdND Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iD8DBQFL1xeRXY6L6fI4GtQRAg/aAKCTJTa3qPxZO9fbLGib487/DKPQOACeIUqt A5UyCnU9+nWyu7mGc7/M394= =ipaZ -----END PGP SIGNATURE----- --d6Gm4EdcadzBjdND-- From owner-freebsd-rc@FreeBSD.ORG Tue Apr 27 17:44:48 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A3E310656A5; Tue, 27 Apr 2010 17:44:48 +0000 (UTC) (envelope-from nlandys@gmail.com) Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com [209.85.221.181]) by mx1.freebsd.org (Postfix) with ESMTP id BAA058FC15; Tue, 27 Apr 2010 17:44:47 +0000 (UTC) Received: by qyk11 with SMTP id 11so16914879qyk.13 for ; Tue, 27 Apr 2010 10:44:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=gSez5EUEm+uPGZwkaOrAzEpcoGSx3TGeiFmmcQmz+W8=; b=S2BeiS1d6quOtZ+Lk8PI1YpWvZGl7nma8SnuzGI1F2vPbfsUpX0wjmJZhyHWBflBoZ b9scRvTTNbDZxYeM7jDzsk1nMTThqw79lD2L29kVSt6ZPdbDSM5L8xEfpfM2um00VcMf YSL+BnXbkkv8pxDzRuisnZYlWEK3A6UxXeI9I= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=H4eUhbEmV+dF4Rw8TouH5SJKdYtiXFQ/OD27m2ZvUt7qt1lxHI9/LDplFIn/O+R9Xl U2bnbEjl7E1mhypoKiWmoESsh1qhInIVOEC8omSJjNMXxkggBJsol2Y/0IsuTu3KP0Gn VFEgAsDyG4QtBKTCMXYog5d9vG+RiXwyyl7Ak= MIME-Version: 1.0 Received: by 10.229.232.144 with SMTP id ju16mr7681044qcb.107.1272388538659; Tue, 27 Apr 2010 10:15:38 -0700 (PDT) Received: by 10.229.102.88 with HTTP; Tue, 27 Apr 2010 10:15:38 -0700 (PDT) In-Reply-To: <20100427165753.GA58954@lor.one-eyed-alien.net> References: <20100426080815.GA41938@icarus.home.lan> <20100427165753.GA58954@lor.one-eyed-alien.net> Date: Tue, 27 Apr 2010 10:15:38 -0700 Message-ID: From: Nerius Landys To: Brooks Davis Content-Type: text/plain; charset=ISO-8859-1 Cc: freebsd-net@freebsd.org, freebsd-rc@freebsd.org, Jeremy Chadwick Subject: Re: rc(8) script -- waiting for the network to become usable 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: Tue, 27 Apr 2010 17:44:48 -0000 > On Mon, Apr 26, 2010 at 01:08:15AM -0700, Jeremy Chadwick wrote: >> Foremost, sorry for the cross-post, but more eyes in this case means >> overall more discussion. Secondly, please keep me CC'd as I'm not on >> either -rc or -net. >> >> I recently proposed addition of a new script to the rc framework which >> verifies (using ping) that layer 3 network connectivity is up/functional >> before continuing on with daemons which require network access: >> >> http://lists.freebsd.org/pipermail/freebsd-stable/2010-April/056400.html >> >> The overall response was positive, with full acknowledgement that this >> is indeed a hack -- yet necessary -- and that something more appropriate >> could probably be introduced into the base system to provide a much >> cleaner solution (launchd was mentioned). >> >> I'd like folks (particularly on -rc) to chime in here, and please see >> about adding this to the base system. > > Given that this would fix the problems many users see in the current > world order and that it's relativly unintrusive I think it's an ok thing > to add. I was having problems with services such as ntpd starting before the network came up on my server. I wrote a similar script in /usr/local/etc/rc.d/ that pings one of the root name servers for 100 seconds or until it responds, whichever comes first. It fixed my problem. So, yeah, a script to do this would be most welcome. From owner-freebsd-rc@FreeBSD.ORG Tue Apr 27 17:49:47 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B05861065670 for ; Tue, 27 Apr 2010 17:49:47 +0000 (UTC) (envelope-from westr@connection.ca) Received: from nc-tor-mail2.connection.ca (nc-tor-mail2.connection.ca [205.207.122.27]) by mx1.freebsd.org (Postfix) with ESMTP id 901E98FC15 for ; Tue, 27 Apr 2010 17:49:47 +0000 (UTC) Received: from westr-main.tor.connection.ca (external.tor.connection.ca [216.234.38.18]) by nc-tor-mail2.connection.ca (Postfix) with ESMTP id B39F074E5AA for ; Tue, 27 Apr 2010 13:35:34 -0400 (EDT) Date: Tue, 27 Apr 2010 13:35:33 -0400 From: Ross West Organization: Network Connection X-Priority: 3 (Normal) Message-ID: <763095613.20100427133533@connection.ca> To: freebsd-rc@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: (no subject) X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ross West 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: Tue, 27 Apr 2010 17:49:47 -0000 -- Ross West Tel: +1 416 967 6767 Network Manager Fax: +1 416 967 7777 Network Connection Email: westr@connection.ca From owner-freebsd-rc@FreeBSD.ORG Tue Apr 27 18:07:02 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D19BC1065778 for ; Tue, 27 Apr 2010 18:07:02 +0000 (UTC) (envelope-from westr@connection.ca) Received: from nc-tor-mail1.connection.ca (nc-tor-mail1.connection.ca [205.207.122.26]) by mx1.freebsd.org (Postfix) with ESMTP id AF7A28FC17 for ; Tue, 27 Apr 2010 18:07:02 +0000 (UTC) Received: from westr-main.tor.connection.ca (external.tor.connection.ca [216.234.38.18]) by nc-tor-mail1.connection.ca (Postfix) with ESMTP id CB74D44B3C2 for ; Tue, 27 Apr 2010 14:07:01 -0400 (EDT) Date: Tue, 27 Apr 2010 14:07:00 -0400 From: Ross West Organization: Network Connection X-Priority: 3 (Normal) Message-ID: <106993233.20100427140700@connection.ca> To: freebsd-rc@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Subject: rc(8) script -- waiting for the network to become usable X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ross West 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: Tue, 27 Apr 2010 18:07:02 -0000 (ugh, sorry about the blank message previously) > The boot-up process will still continue regardless if the ping check > passed or failed. It just means that daemons/services attempting to use > the network and *expect* connectivity to work may not function > correctly (meaning: they'll behave just like they already do. ;-) ) A thought that I had on this would be to create another placeholder in the /etc/rc.d directory which would allow better reordering of those applications that require layer3+ connectivity for their operations. As an example - Using the placeholder of "INTERNET" which is simply defined in (/etc/rc.d/INTERNET) as this: -= #!/bin/sh # # PROVIDE: INTERNET # REQUIRE: NETWORKING -= This allows scripts like the earlier suggested waitnetwork to be called before it's execution with the "BEFORE:" rc keyword and not be tied to other scripts like mountcritremote. If you don't like the waitnetwork script, then you can just add your own to /usr/local/etc/rc.d very easily. (eg: What about a second script for ipv6??) Other scripts can easily then use the keyword without having the worry about ordering issues that might arise unexpectedly if something changes in the future. The more I think of this, the keyword of "internet" isn't the best, and something like "CONNECTIVITY" would be better, although the keyword of INTERNET would probably be used more often correctly by rc.d script authors. :-) Also probably need to bind the REQUIRE rc keyword to something else like SERVERS or DAEMON or even LOGIN. That would be better so it happens much later in the startup - things like dhclient don't happen until the very end after LOGIN even. (running rcorder(8) can show interesting ordering choices it makes) Thoughts? -- From owner-freebsd-rc@FreeBSD.ORG Tue Apr 27 20:34:06 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 331BC106566B for ; Tue, 27 Apr 2010 20:34:06 +0000 (UTC) (envelope-from cswiger@mac.com) Received: from asmtpout026.mac.com (asmtpout026.mac.com [17.148.16.101]) by mx1.freebsd.org (Postfix) with ESMTP id 1D3168FC13 for ; Tue, 27 Apr 2010 20:34:06 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; charset=us-ascii Received: from cswiger1.apple.com ([17.209.4.71]) by asmtp026.mac.com (Sun Java(tm) System Messaging Server 6.3-8.01 (built Dec 16 2008; 32bit)) with ESMTPSA id <0L1J001G4VOQJ580@asmtp026.mac.com>; Tue, 27 Apr 2010 12:34:04 -0700 (PDT) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx engine=5.0.0-0908210000 definitions=main-1004270164 From: Chuck Swiger In-reply-to: <20100426085947.GB20779@megatron.madpilot.net> Date: Tue, 27 Apr 2010 12:34:01 -0700 Message-id: References: <20100426080815.GA41938@icarus.home.lan> <20100426085947.GB20779@megatron.madpilot.net> To: Guido Falsi X-Mailer: Apple Mail (2.1078) Cc: "freebsd-net@freebsd.org Net" , freebsd-rc@freebsd.org Subject: Re: rc(8) script -- waiting for the network to become usable 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: Tue, 27 Apr 2010 20:34:06 -0000 Hi, all-- On Apr 26, 2010, at 1:59 AM, Guido Falsi wrote: > Regarding launchd, I don't know much about it, but I do like the rc > system and having the boot sequence managed by scripts one can easily > modify to taste. I'd rather not modify this system with some daemon > performing obscure tasks based on some configuration file. The > flexibility given by scripts is imho, quite superior to any configurable > daemon's. Launchd is intended to replace the combination of init, rc startup scripts, (x)inetd, and cron/at. People who are happy with the traditional Unix distinctions between all of above (and/or do not care for XML plists) may not be fans of launchd. If you're using a Unix box in the traditional role of a server which is always on with permanent Internet connectivity, these traditional Unix mechanisms work just fine. Launchd is intended to deal with the opposite conditions (although it also works okay for permanent server roles, too); ie, it has scheduled jobs, but it will run ones which didn't execute at a particular time because the machine was asleep via StartInterval or StartCalendarInterval: StartCalendarInterval This optional key causes the job to be started every calendar interval as specified. Missing argu- ments are considered to be wildcard. The semantics are much like crontab(5). Unlike cron which skips job invocations when the computer is asleep, launchd will start the job the next time the com- puter wakes up. If multiple intervals transpire before the computer is woken, those events will be coalesced into one event upon wake from sleep. It also includes the notion of whether the machine has working network connectivity as an explicit condition which jobs can use to determine whether they should run or not. Wandering around with a laptop as you go into and out of range of wireless networks is a case which tends to require significant interaction from someone with root access to the box to restart things which should have gone down when there was no network and are in a silly state, whereas it's handled reasonably well by launchd-controlled stuff via KeepAlive / NetworkState: http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man5/launchd.plist.5.html I'm not in love with launchd, or XML plists, either, but it comes closer to resolving issues of running stuff on demand, keeping track of what's actively being used (and should be given a SIGTERM to have a chance to shutdown cleanly rather than a SIGKILL), tracking what needs to run under limited contexts (chroot, non-root userids, setrlimit() stuff, what has access to things like the window system or login window contexts, etc) than the alternatives do. For example, the /etc/rc.subr mechanism supports chroot & non-root users fine, but has no way I'm familiar with to indicate that something maybe should not be running if nobody is logged into the machine and it is sitting at xdm, gdm, or whatever's login screen. Regards, -- -Chuck From owner-freebsd-rc@FreeBSD.ORG Tue Apr 27 21:59:52 2010 Return-Path: Delivered-To: freebsd-rc@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97700106564A; Tue, 27 Apr 2010 21:59:52 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 709DA8FC0A; Tue, 27 Apr 2010 21:59:52 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o3RLxq9T085074; Tue, 27 Apr 2010 21:59:52 GMT (envelope-from jilles@freefall.freebsd.org) Received: (from jilles@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o3RLxqbr085070; Tue, 27 Apr 2010 21:59:52 GMT (envelope-from jilles) Date: Tue, 27 Apr 2010 21:59:52 GMT Message-Id: <201004272159.o3RLxqbr085070@freefall.freebsd.org> To: jilles@FreeBSD.org, freebsd-bugs@FreeBSD.org, freebsd-rc@FreeBSD.org From: jilles@FreeBSD.org Cc: Subject: Re: conf/146053: [patch] [request] shutdown of jails breaks inter-jail dependencies 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: Tue, 27 Apr 2010 21:59:52 -0000 Old Synopsis: shutdown of jails breaks intra-jail dependencies New Synopsis: [patch] [request] shutdown of jails breaks inter-jail dependencies Responsible-Changed-From-To: freebsd-bugs->freebsd-rc Responsible-Changed-By: jilles Responsible-Changed-When: Tue Apr 27 21:58:27 UTC 2010 Responsible-Changed-Why: Assign to correct mailing list, fix category. http://www.freebsd.org/cgi/query-pr.cgi?pr=146053 From owner-freebsd-rc@FreeBSD.ORG Tue Apr 27 22:41:32 2010 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E096106566B for ; Tue, 27 Apr 2010 22:41:32 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [131.155.140.104]) by mx1.freebsd.org (Postfix) with ESMTP id 468238FC17 for ; Tue, 27 Apr 2010 22:41:32 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 8B38135A84A for ; Wed, 28 Apr 2010 00:41:01 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 762E217520; Wed, 28 Apr 2010 00:41:01 +0200 (CEST) Date: Wed, 28 Apr 2010 00:41:01 +0200 From: Jilles Tjoelker To: freebsd-rc@FreeBSD.org Message-ID: <20100427224101.GD7165@stack.nl> References: <201004272159.o3RLxqbr085070@freefall.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201004272159.o3RLxqbr085070@freefall.freebsd.org> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: Subject: Re: conf/146053: [patch] [request] shutdown of jails breaks inter-jail dependencies 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: Tue, 27 Apr 2010 22:41:32 -0000 On Tue, Apr 27, 2010 at 09:59:52PM +0000, jilles@FreeBSD.org wrote: > Old Synopsis: shutdown of jails breaks intra-jail dependencies > New Synopsis: [patch] [request] shutdown of jails breaks inter-jail dependencies Is there any reason why someone may want to have jails shut down in the same order they were started, instead of in the reverse order? -- Jilles Tjoelker From owner-freebsd-rc@FreeBSD.ORG Tue Apr 27 23:26:41 2010 Return-Path: Delivered-To: freebsd-rc@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 968CB106566C for ; Tue, 27 Apr 2010 23:26:41 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from tarsier.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by mx1.freebsd.org (Postfix) with ESMTP id E559D8FC17 for ; Tue, 27 Apr 2010 23:26:40 +0000 (UTC) Received: from mail.geekcn.org (tarsier.geekcn.org [211.166.10.233]) by tarsier.geekcn.org (Postfix) with ESMTP id 216D1A5A57A; Wed, 28 Apr 2010 07:07:33 +0800 (CST) X-Virus-Scanned: amavisd-new at geekcn.org Received: from tarsier.geekcn.org ([211.166.10.233]) by mail.geekcn.org (mail.geekcn.org [211.166.10.233]) (amavisd-new, port 10024) with LMTP id G2SX4JkN3fTJ; Wed, 28 Apr 2010 07:07:27 +0800 (CST) Received: from delta.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tarsier.geekcn.org (Postfix) with ESMTPSA id 4C430A56D5B; Wed, 28 Apr 2010 07:07:26 +0800 (CST) DomainKey-Signature: a=rsa-sha1; s=default; d=delphij.net; c=nofws; q=dns; h=message-id:date:from:reply-to:organization:user-agent: mime-version:to:cc:subject:references:in-reply-to: x-enigmail-version:openpgp:content-type:content-transfer-encoding; b=enp/dYbBW2LH2S0y6YCvG7JRH+LmKpUqjedARTug83RFvc4UT54iAyoHSLzFdscWO q78G6F12O9XSwGxmuBG+g== Message-ID: <4BD76E2A.7080504@delphij.net> Date: Tue, 27 Apr 2010 16:07:22 -0700 From: Xin LI Organization: The Geek China Organization User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.9) Gecko/20100408 Thunderbird/3.0.4 ThunderBrowse/3.2.8.1 MIME-Version: 1.0 To: Jilles Tjoelker References: <201004272159.o3RLxqbr085070@freefall.freebsd.org> <20100427224101.GD7165@stack.nl> In-Reply-To: <20100427224101.GD7165@stack.nl> X-Enigmail-Version: 1.0.1 OpenPGP: id=3FCA37C1; url=http://www.delphij.net/delphij.asc Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-rc@FreeBSD.ORG Subject: Re: conf/146053: [patch] [request] shutdown of jails breaks inter-jail dependencies X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: d@delphij.net 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: Tue, 27 Apr 2010 23:26:41 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 2010/04/27 15:41, Jilles Tjoelker wrote: > On Tue, Apr 27, 2010 at 09:59:52PM +0000, jilles@FreeBSD.org wrote: >> Old Synopsis: shutdown of jails breaks intra-jail dependencies >> New Synopsis: [patch] [request] shutdown of jails breaks inter-jail dependencies > > Is there any reason why someone may want to have jails shut down in the > same order they were started, instead of in the reverse order? Yes I believe this is useful. For instance, one may run LDAP service in one jail and e-mail service in another, and wants LDAP service always be available to e-mail services. Cheers, - -- Xin LI http://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.14 (FreeBSD) iQEcBAEBAgAGBQJL124qAAoJEATO+BI/yjfBk3oIAML6kcBda9uY3Djq8uptS2Mb J4XaAD9HyJNx73ZvAT2CBQrevujueNSDfWEdIscl0ltI25sN5oD5n8goIV2USuD/ yfLcNijvJk2FSX5QF5i/2OWcjMO7X05hI4Gv7j72pA+mMoH83TpqKgWPfb34qQ/h D6n7EEmh8l/htmGS5fU5aHfFDg3hkUPj0oUwiTMsF/k0cgNLlzsBJPtrNnVHlzZt TGIqr/b93M80NU87pYZEjvnYw5A0I6mdYoZc8NbgZV1S5hNDHKcE2FJVIzH2Dyw/ 0+8TANwJf/C4TSFieokmmyNxDpCG8qWKMMOk6i85Pxj1yXEv4vb79vScz9Ov4F4= =cOGf -----END PGP SIGNATURE----- From owner-freebsd-rc@FreeBSD.ORG Wed Apr 28 09:58:15 2010 Return-Path: Delivered-To: freebsd-rc@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB09F1065670 for ; Wed, 28 Apr 2010 09:58:15 +0000 (UTC) (envelope-from uffe@uffe.org) Received: from mail.starion.dk (mx0.starion.dk [83.95.112.88]) by mx1.freebsd.org (Postfix) with SMTP id 387A88FC12 for ; Wed, 28 Apr 2010 09:58:14 +0000 (UTC) Received: (qmail 12908 invoked by uid 528); 28 Apr 2010 09:31:54 -0000 Received: from 212.130.59.4 ([212.130.59.4]) by mail.starion.dk ([192.168.0.100]) with ESMTP via TCP; 28 Apr 2010 09:31:54 -0000 Message-ID: <4BD80074.80209@uffe.org> Date: Wed, 28 Apr 2010 11:31:32 +0200 From: Uffe Jakobsen User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: freebsd-rc@FreeBSD.org References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: Re: Trivial PR, fix shutdown of rc services started with onestart (fwd) 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: Wed, 28 Apr 2010 09:58:15 -0000 On 14/04/10 22.18, Doug Barton wrote: > > However there is a reasonable argument to be > made for having things work when the system is shut down. > > ... > > I'm not sure the patch in the PR is right (mostly for lack of > examination or testing), but I'm wondering what people think about the > general idea of having the shutdown action ignore whether _enable is on? > Sorry for my late response - I just returned from vacation. I'll vote for this change - this have been bugging me for some years now... /Uffe From owner-freebsd-rc@FreeBSD.ORG Fri Apr 30 21:00:47 2010 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 93ACD106566C for ; Fri, 30 Apr 2010 21:00:47 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay02.stack.nl [131.155.140.104]) by mx1.freebsd.org (Postfix) with ESMTP id 5982E8FC1B for ; Fri, 30 Apr 2010 21:00:47 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id E487D35A83C; Fri, 30 Apr 2010 23:00:45 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id D0C7217555; Fri, 30 Apr 2010 23:00:45 +0200 (CEST) Date: Fri, 30 Apr 2010 23:00:45 +0200 From: Jilles Tjoelker To: Andriy Gapon Message-ID: <20100430210045.GA47661@stack.nl> References: <4BCA090E.1040403@icyb.net.ua> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4BCA090E.1040403@icyb.net.ua> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-rc@freebsd.org Subject: Re: rc.d/root: handle filesystems with r/o support only 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: Fri, 30 Apr 2010 21:00:47 -0000 On Sat, Apr 17, 2010 at 10:16:30PM +0300, Andriy Gapon wrote: > Could you please review the following patch? > The idea is to not try to remount root R/W if root filesystem supports > only R/O. For example, cd9660. This should make life easier for live > CDs that use standard rc startup. Currently one has to either put a > root fs entry into fstab (and thus guess root device name, e.g. cd0 vs > acd0) or to specify root_rw_mount="NO" in rc.conf. This change > attempts to guess that automatically. This looks useful, although modifying rc.conf doesn't seem too much of a burden for a livecd. > I think that things like ro_fs_list, in_list and is_readonly_fs could > be shared with other rc scripts. > E.g. see http://www.freebsd.org/cgi/query-pr.cgi?pr=conf/116931 > P.S. sorry if the code style and structure differs from conventions. > --- a/etc/rc.d/root > +++ b/etc/rc.d/root > @@ -13,11 +13,54 @@ name="root" > start_cmd="root_start" > stop_cmd=":" > > +ro_fs_list="cd9660 udf" > + > +in_list() > +{ > + local _x _list _i > + > + _x=$1 > + _list=$2 > + for _i in ${_list}; do > + [ "${_x}" = "${_i}" ] && return 0 > + done > + return 1 > +} case " $_list " in *" $_x "*) return 0;; *) return 1;; esac This also works if the list elements contain metacharacters or IFS characters other than space (tab/newline). Although many of the functions in rc.subr break when given such input, I don't think that's an excuse for adding more functions that are broken like that. (You could also fix it using local IFS=' ' - set -f but 'local -' is a non-portable ash feature to save/restore the options; doing this portably needs more code.) Alternatively, the code case "$fstype" in cd9660|udf) return 0;; *) return 1;; esac could be put in a function. > + > +is_readonly_fs() > +{ > + local _arg _ret > + > + _arg="$1" ; shift > + _ret=`mount -p | while read _dev _mp _type _rest; do > + [ $_mp = "$_arg" ] || continue > + echo $_type > + break > + done` > + > + if [ -z "${_ret}" ]; then > + warn "root filesystem not found" Hmm, the function still becomes /-specific in the debug messages. > + return 1 > + fi > + if in_list "${_ret}" "${ro_fs_list}"; then > + info "read-only root filesystem type: ${_ret}" > + return 0 > + else > + info "read-write root filesystem type: ${_ret}" > + return 1 > + fi > +} > + > root_start() > { > # root normally must be read/write, but if this is a BOOTP NFS > # diskless boot it does not have to be. > # > + > + if is_readonly_fs '/' ; then > + root_rw_mount="NO" > + fi > + > case ${root_rw_mount} in > [Nn][Oo] | '') > ;; -- Jilles Tjoelker