Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Jul 2007 13:19:51 +0200 (CEST)
From:      =?ISO-8859-2?Q?Bart=B3omiej?= Rutkowski <brutkowski@lerkins.com>
To:        Maxim Vetrov <muxas@mail.ru>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: Possible devd bug
Message-ID:  <20070720111951.522738441C@stasis01.lerkins.com>
In-Reply-To: <46A127FF.7040507@mail.ru>
References:  <20070720093449.630B98441D@stasis01.lerkins.com> <46A127FF.7040507@mail.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 20 Jul 2007 21:24:15 +0000
Maxim Vetrov <muxas@mail.ru> wrote:

> Bart?omiej Rutkowski wrote:
> > Hi all,
> >
> > I have been playing with OpenOspf lately, and I came to a place, when I=
 needed to ensure that an ethernet interface should always go into DOWN sta=
te when it loses its link (physically, for example the switch becames turne=
d off). I have tried to hire the devd daemon to do the job with such small =
definitions:
> >
> > 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";
> > };
> >
> > And what is happening? Well, basically, when the interface detects that=
 eth cable has been detached, devd triggers and makes it DOWN, which is ok.=
 But, when the card got the cable attached once again (and interface detect=
s 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 prope=
r logging actions, and when interface is UP devd gets the proper state chan=
ges information.=20
> >
> > Now the question is: why devd doesent receive any information from inte=
rfaces in DOWN state? Is that proper behaviour, or a bug? Thanks for any re=
ply, and for your attention.
> >
> > P.S. I am resending this message to freebsd-stable list, as I am not su=
re if freebsd-questions was a proper choice.
> >
> >  =20
> Probably, there is another notify which action is executed before yours=20
> :-) Devd stops scanning sections on the _first_ matched one. Run devd in=
=20
> debug mode and watch
>=20
> Regards,
> Muxas

I did my tests with debugging and logger in action directives and now I can=
 confirm that
devd does not trigger, when you put eth interface into DOWN state by "#ifco=
nfig ifnameX down".
Now, is that intentional behaviour or a bug? This makes those LINK_UP devd =
triggers=20
totally unusable.=20
You can test this behaviour with such example ruleset: http://rafb.net/p/gT=
m9CW93.html


--=20
Bart=B3omiej Rutkowski <brutkowski@lerkins.com>



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