misc/166321: devd rule is not processed
Stefan Balu
balustefan at gmail.com
Thu Mar 22 22:20:06 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:55:34 +0200
--e89a8ff1c378207e4c04bbdb2137
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
And i also tried changing the `attach` keyword into a `nomatch` rule.
According to `devd.conf(8)`, a rule with a higher priority wins, so it
should have matched before `usb.conf` file's rules. Trying with the full
path to `chown` in the `action` statement doesn't seem to work either.
This was my latest failure:
[root at fw /usr/home/packardb]# cat /etc/devd/nut.conf
attach 100 {
device-name "ugen1.3";
match "vendor" "0x0665";
match "product" "0x5161";
action "/usr/sbin/chown uucp /dev/$device-name";
};
On Thu, Mar 22, 2012 at 10:27 PM, Stefan Balu <balustefan at gmail.com> wrote:
> 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|c=
iss|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=
=3DHOST
>> 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
>>
>
>
>
> --
> =C8=98tefan B=C4=82LU
> Tel: +40757 377 489
>
--=20
=C8=98tefan B=C4=82LU
Tel: +40757 377 489
--e89a8ff1c378207e4c04bbdb2137
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
And i also tried changing the `attach` keyword into a `nomatch` rule. Accor=
ding to `devd.conf(8)`, a rule with a higher priority wins, so it should ha=
ve matched before `usb.conf` file's rules. Trying with the full path to=
`chown` in the `action` statement doesn't seem to work either.=C2=A0<d=
iv>
<br></div><div>This was my latest failure:</div><div><br></div><div><div>[r=
oot at fw /usr/home/packardb]# cat /etc/devd/nut.conf=C2=A0</div><div>attach 1=
00 {</div><div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </=
span>device-name "ugen1.3";</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>match=
"vendor" "0x0665";</div><div><span class=3D"Apple-tab-=
span" style=3D"white-space:pre"> </span>match "product" "0x5=
161";</div>
<div><span class=3D"Apple-tab-span" style=3D"white-space:pre"> </span>actio=
n "/usr/sbin/chown uucp /dev/$device-name";</div><div>};</div><di=
v><br></div><div><br><div class=3D"gmail_quote">On Thu, Mar 22, 2012 at 10:=
27 PM, Stefan Balu <span dir=3D"ltr"><<a href=3D"mailto:balustefan at gmail=
.com">balustefan at gmail.com</a>></span> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">This doesn't seem to fix the problem. I =
forgot to mention that i also thought it was a regex missmatch, and i'v=
e tried ugen[0-9.]+ and also ugen[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"text-align:left;font-size:11px;font-family:verdana,sans-seri=
f">Testing bus=3Duhub3 against ^uhub[0-9]+</span><br style=3D"text-align:le=
ft;font-size:11px;font-family:verdana,sans-serif">
<span style=3D"text-align:left;font-size:11px;font-family:verdana,sans-seri=
f">Testing mode=3Dhost against ^host</span><br style=3D"text-align:left;fon=
t-size:11px;font-family:verdana,sans-serif">
<span style=3D"text-align:left;font-size:11px;font-family:verdana,sans-seri=
f">Testing intclass=3D0x03 against ^0x03</span></div><div><div style=3D"tex=
t-align:left"><font face=3D"verdana, sans-serif"><span style=3D"font-size:1=
1px"><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><div><div class=3D"h5"><br><div class=3D"gmail_quote">On Thu=
, Mar 22, 2012 at 8:24 PM, Gary Palmer <span dir=3D"ltr"><<a href=3D"mai=
lto:gpalmer at freebsd.org" target=3D"_blank">gpalmer at freebsd.org</a>></spa=
n> wrote:<br>
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex">
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><font color=3D"#888888"><br>
Gary<br>
</font></span></blockquote></div><br><br clear=3D"all"><div><br></div></div=
></div><span class=3D"HOEnZb"><font color=3D"#888888">-- <br>=C8=98tefan B=
=C4=82LU<br>Tel: +40757 377 489<br>
</font></span></div></div></div>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>=C8=98tefan =
B=C4=82LU<br>Tel: +40757 377 489<br>
</div></div>
--e89a8ff1c378207e4c04bbdb2137--
More information about the freebsd-bugs
mailing list