misc/166321: devd rule is not processed
Stefan Balu
balustefan at gmail.com
Thu Mar 22 22:20:04 UTC 2012
The following reply was made to PR misc/166321; it has been noted by GNATS.
From: Stefan Balu <balustefan at gmail.com>
To: Gary Palmer <gpalmer at freebsd.org>
Cc:
Subject: Re: misc/166321: devd rule is not processed
Date: Thu, 22 Mar 2012 22:27:54 +0200
--047d7b15a97f24062504bbdabe05
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
This doesn't seem to fix the problem. I forgot to mention that i also
thought it was a regex missmatch, and i've tried ugen[0-9.]+ and also
ugen[0-9\.] and i've also tried ugen[0-9]+.[0-9]+ with no luck.
I thought the problem has to do with the `/etc/devd/usb.conf` file which
exists on 9.0 and didn't existed on 8.2. From the devd's debugging i see
that the last matched rule is:
Testing bus=3Duhub3 against ^uhub[0-9]+
Testing mode=3Dhost against ^host
Testing intclass=3D0x03 against ^0x03
which is present in the `usb.conf` file.
I suspect that `devd`, for some reason, doesn't really try to match against
the rules from my `nut.conf` file. However, when `devd` starts in debugging
mode, it does mention parsing my file:
[root at fw /usr/home/packardb]# devd -D -d
Parsing /etc/devd.conf
setting
scsi-controller-regex=3D(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|asr|bt|cis=
s|ct|dpt|esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)[0-9]+
Parsing files in /etc/devd
Parsing /etc/devd/asus.conf
Parsing /etc/devd/uath.conf
Parsing /etc/devd/usb.conf
Parsing files in /usr/local/etc/devd
Parsing /usr/local/etc/devd/nut.conf
...
And i've also symlink()ed my `nut.conf` file in /etc/devd/ directory.
Still, no luck!
On Thu, Mar 22, 2012 at 8:24 PM, Gary Palmer <gpalmer at freebsd.org> wrote:
> On Thu, Mar 22, 2012 at 06:01:48PM +0000, Stefan BALU wrote:
> > I have a UPS box which works like a charm with nut (netwok-ups-tools).
> In order for the nut driver to properly work, it needs the `/dev/ugen*`
> file to be owned by `uucp`.
> >
> > In order to do this, i have a `devd(8)` configuration file in
> `/usr/local/etc/devd/` entitled `nut.conf`.
> >
> > [root at fw ~]# cat /usr/local/etc/devd/nut.conf
> > attach 100 {
> > match "device-name" "ugen[0-9]+";
> > match "vendor" "0x0665";
> > match "product" "0x5161";
> > action "logger chown uucp /dev/$device-name*";
> > };
> >
> > [root at fw ~]# usbconfig dump_device_desc
> > ..
> > ugen1.3: <USB to Serial Cypress Semiconductor> at usbus1, cfg=3D0 md=3D=
HOST
> spd=3DLOW (1.5Mbps) pwr=3DON
> >
>
> The reason is in the above information. You are matching against
> "ugen[0-9]+" but the device is "ugen1.3". Note that [0-9]+ means one or
> more characters from the set of 0 through 9. No ".". Try fixing the
> ugen regular expression to allow for the ".". e.g.
>
> "ugen[0-9.]+"
>
> or
>
> "ugen[0-9]+.[0-9]+"
>
> Gary
>
--=20
=C8=98tefan B=C4=82LU
Tel: +40757 377 489
--047d7b15a97f24062504bbdabe05
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
This doesn't seem to fix the problem. I forgot to mention that i also t=
hought it was a regex missmatch, and i've tried ugen[0-9.]+ and also ug=
en[0-9\.] and=C2=A0i've also tried ugen[0-9]+.[0-9]+ with no luck.<div>=
<br>
</div><div>I thought the problem has to do with the `/etc/devd/usb.conf` fi=
le which exists on 9.0 and didn't existed on 8.2. From the devd's d=
ebugging i see that the last matched rule is:</div><div><br></div><div>
<span style=3D"font-family:verdana,sans-serif;font-size:11px;text-align:lef=
t;background-color:rgb(255,255,255)">Testing bus=3Duhub3 against ^uhub[0-9]=
+</span><br style=3D"font-family:verdana,sans-serif;font-size:11px;text-ali=
gn:left;background-color:rgb(255,255,255)">
<span style=3D"font-family:verdana,sans-serif;font-size:11px;text-align:lef=
t;background-color:rgb(255,255,255)">Testing mode=3Dhost against ^host</spa=
n><br style=3D"font-family:verdana,sans-serif;font-size:11px;text-align:lef=
t;background-color:rgb(255,255,255)">
<span style=3D"font-family:verdana,sans-serif;font-size:11px;text-align:lef=
t;background-color:rgb(255,255,255)">Testing intclass=3D0x03 against ^0x03<=
/span></div><div><div style=3D"text-align:left"><font face=3D"verdana, sans=
-serif"><span style=3D"font-size:11px"><br>
</span></font></div><div style=3D"text-align:left"><font face=3D"verdana, s=
ans-serif"><span style=3D"font-size:11px">which is present in the `usb.conf=
` file.</span></font></div><div style=3D"text-align:left"><font face=3D"ver=
dana, sans-serif"><span style=3D"font-size:11px"><br>
</span></font></div><div style=3D"text-align:left"><font face=3D"verdana, s=
ans-serif"><span style=3D"font-size:11px">I suspect that `devd`, for some r=
eason, doesn't really try to match against the rules from my `nut.conf`=
file. However, when `devd` starts in debugging mode, it does mention parsi=
ng my file:</span></font></div>
<div style=3D"text-align:left"><font face=3D"verdana, sans-serif"><span sty=
le=3D"font-size:11px"><br></span></font></div><div style=3D"text-align:left=
"><font face=3D"verdana, sans-serif"><div><span style=3D"font-size:11px"><d=
iv>[root at fw /usr/home/packardb]# devd -D -d</div>
Parsing /etc/devd.conf</span></div><div><span style=3D"font-size:11px">sett=
ing scsi-controller-regex=3D(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|asr|bt=
|ciss|ct|dpt|esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)[0=
-9]+</span></div>
<div><span style=3D"font-size:11px">Parsing files in /etc/devd</span></div>=
<div><span style=3D"font-size:11px">Parsing /etc/devd/asus.conf</span></div=
><div><span style=3D"font-size:11px">Parsing /etc/devd/uath.conf</span></di=
v>
<div><span style=3D"font-size:11px">Parsing /etc/devd/usb.conf</span></div>=
<div><span style=3D"font-size:11px">Parsing files in /usr/local/etc/devd</s=
pan></div><div><span style=3D"font-size:11px">Parsing /usr/local/etc/devd/n=
ut.conf</span></div>
<div style=3D"font-size:11px">...</div><div style=3D"font-size:11px"><br></=
div><div style=3D"font-size:11px">And i've also symlink()ed my `nut.con=
f` file in /etc/devd/ directory. Still, no luck!</div></font></div><div><di=
v>
<br></div><div><br><div class=3D"gmail_quote">On Thu, Mar 22, 2012 at 8:24 =
PM, Gary Palmer <span dir=3D"ltr"><<a href=3D"mailto:gpalmer at freebsd.org=
">gpalmer at freebsd.org</a>></span> wrote:<br><blockquote class=3D"gmail_q=
uote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1e=
x">
On Thu, Mar 22, 2012 at 06:01:48PM +0000, Stefan BALU wrote:<br>
> I have a UPS box which works like a charm with nut (netwok-ups-tools).=
In order for the nut driver to properly work, it needs the `/dev/ugen*` fi=
le to be owned by `uucp`.<br>
><br>
> In order to do this, i have a `devd(8)` configuration file in `/usr/lo=
cal/etc/devd/` entitled `nut.conf`.<br>
><br>
> [root at fw ~]# cat /usr/local/etc/devd/nut.conf<br>
> attach 100 {<br>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 match "device-name" "ugen[0=
-9]+";<br>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 match "vendor" "0x0665"=
;;<br>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 match "product" "0x5161&quo=
t;;<br>
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 action "logger chown uucp /dev/$devic=
e-name*";<br>
> };<br>
><br>
> [root at fw ~]# usbconfig dump_device_desc<br>
> ..<br>
> ugen1.3: <USB to Serial Cypress Semiconductor> at usbus1, cfg=3D=
0 md=3DHOST spd=3DLOW (1.5Mbps) pwr=3DON<br>
><br>
<br>
The reason is in the above information. =C2=A0You are matching against<br>
"ugen[0-9]+" but the device is "ugen1.3". =C2=A0Note th=
at [0-9]+ means one or<br>
more characters from the set of 0 through 9. =C2=A0No ".". =C2=A0=
Try fixing the<br>
ugen regular expression to allow for the ".". =C2=A0e.g.<br>
<br>
"ugen[0-9.]+"<br>
<br>
or<br>
<br>
"ugen[0-9]+.[0-9]+"<br>
<span class=3D"HOEnZb"><font color=3D"#888888"><br>
Gary<br>
</font></span></blockquote></div><br><br clear=3D"all"><div><br></div>-- <b=
r>=C8=98tefan B=C4=82LU<br>Tel: +40757 377 489<br>
</div></div></div>
--047d7b15a97f24062504bbdabe05--
More information about the freebsd-bugs
mailing list