From owner-freebsd-questions@FreeBSD.ORG Fri Jul 20 10:41:54 2007 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2AE116A419 for ; Fri, 20 Jul 2007 10:41:54 +0000 (UTC) (envelope-from freebsd@meijome.net) Received: from sigma.octantis.com.au (ns2.octantis.com.au [207.44.189.124]) by mx1.freebsd.org (Postfix) with ESMTP id A269213C46A for ; Fri, 20 Jul 2007 10:41:54 +0000 (UTC) (envelope-from freebsd@meijome.net) Received: (qmail 8480 invoked from network); 20 Jul 2007 05:41:54 -0500 Received: from 203-206-233-219.dyn.iinet.net.au (HELO localhost) (203.206.233.219) by sigma.octantis.com.au with (DHE-RSA-AES256-SHA encrypted) SMTP; 20 Jul 2007 05:41:51 -0500 Date: Fri, 20 Jul 2007 20:41:46 +1000 From: Norberto Meijome To: Cc: freebsd-questions@freebsd.org Message-ID: <20070720204146.0ef7c20d@localhost> In-Reply-To: <20070720072855.134EF84419@stasis01.lerkins.com> References: <20070720072855.134EF84419@stasis01.lerkins.com> X-Mailer: Claws Mail 2.10.0 (GTK+ 2.10.14; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: Possible devd bug X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 20 Jul 2007 10:41:54 -0000 On Fri, 20 Jul 2007 09:28:55 +0200 (CEST) Bart=C5=82omiej Rutkowski wrote: > Hi all, >=20 > I have been playing with OpenOspf lately, and I came to a place, when I n= eeded to ensure that an ethernet interface should always go into DOWN state= when it loses its link (physically, for example the switch becames turned = off). I have tried to hire the devd daemon to do the job with such small de= finitions: >=20 > notify 100 { > match "system" "IFNET"; > match "type" "LINK_DOWN"; > media-type "ethernet"; > action "/sbin/ifconfig $subsystem down"; > }; > =20 > notify 200 { > match "system" "IFNET"; > match "type" "LINK_UP"; > media-type "ethernet"; > action "/sbin/ifconfig $subsystem up"; > }; >=20 > And what is happening? Well, basically, when the interface detects that e= th cable has been detached, devd triggers and makes it DOWN, which is ok. B= ut, when the card got the cable attached once again (and interface detects = the media type and gets ACTIVE state) devd never triggers the second rule, = which should get the interface UP again.=20 > I have tried that with replacing action statements with ones with proper = logging actions, and when interface is UP devd gets the proper state change= s information.=20 >=20 > Now the question is: why devd doesent receive any information from interf= aces in DOWN state? Is that proper behaviour, or a bug? Thanks for any repl= y, and for your attention. >=20 hi , What do you get when you run devd in debug mode : /etc/rc.d/devd stop /sbin/devd -d -D in my case, i get the following on pulling the cat5 on bge0 [root@ayiin] [Fri Jul 20 20:36:28 2007] /usr/home/betom # /sbin/devd -D -d Parsing /etc/devd.conf setting scsi-controller-regex=3D(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|as= r|bt|ciss|ct|dpt|esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wd= s)[0-9]+ Parsing files in /etc/devd Parsing files in /usr/local/etc/devd Parsing /usr/local/etc/devd/ayiin.conf Processing event '!system=3DIFNET subsystem=3Dbge0 type=3DLINK_DOWN' Pushing table setting system=3DIFNET setting subsystem=3Dbge0 setting type=3DLINK_DOWN Processing notify event Testing system=3DIFNET against ^ACPI Testing system=3DIFNET against ^ACPI Testing system=3DIFNET against ^ACPI Testing system=3DIFNET against ^ACPI Testing system=3DIFNET against ^ACPI Testing system=3DIFNET against ^ACPI Testing system=3DIFNET against ^ACPI Testing system=3DIFNET against ^IFNET Testing type=3DLINK_DOWN against ^ATTACH Testing system=3DIFNET against ^IFNET Testing type=3DLINK_DOWN against ^DETACH Testing system=3DIFNET against ^IFNET Testing type=3DLINK_DOWN against ^LINK_UP Testing system=3DIFNET against ^IFNET Testing type=3DLINK_DOWN against ^LINK_UP Popping table [AND HERE I PLUG IT BACK IN ] Processing event '!system=3DIFNET subsystem=3Dbge0 type=3DLINK_UP' Pushing table setting system=3DIFNET setting subsystem=3Dbge0 setting type=3DLINK_UP Processing notify event Testing system=3DIFNET against ^ACPI Testing system=3DIFNET against ^ACPI Testing system=3DIFNET against ^ACPI Testing system=3DIFNET against ^ACPI Testing system=3DIFNET against ^ACPI Testing system=3DIFNET against ^ACPI Testing system=3DIFNET against ^ACPI Testing system=3DIFNET against ^IFNET Testing type=3DLINK_UP against ^ATTACH Testing system=3DIFNET against ^IFNET Testing type=3DLINK_UP against ^DETACH Testing system=3DIFNET against ^IFNET Testing type=3DLINK_UP against ^LINK_UP Testing media type of bge0 against 0x20 bge0 has media type 0x20 Executing '/etc/rc.d/dhclient start bge0' Popping table ----- do you get the LINK_UP event at all?=20 Otherwise, you should be able to figure out what the issue is with your co= nfig file ... Good luck, _________________________ {Beto|Norberto|Numard} Meijome "Too bad ignorance isn't painful." Don Lindsay I speak for myself, not my employer. Contents may be hot. Slippery when wet= . Reading disclaimers makes you go blind. Writing them is worse. You have b= een Warned.