Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jul 2007 20:41:46 +1000
From:      Norberto Meijome <freebsd@meijome.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Possible devd bug
Message-ID:  <20070720204146.0ef7c20d@localhost>
In-Reply-To: <20070720072855.134EF84419@stasis01.lerkins.com>
References:  <20070720072855.134EF84419@stasis01.lerkins.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 20 Jul 2007 09:28:55 +0200 (CEST)
Bart=C5=82omiej Rutkowski <brutkowski@lerkins.com> 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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070720204146.0ef7c20d>