From owner-freebsd-stable@FreeBSD.ORG Sat Jun 16 06:05:25 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1FD9E106566B for ; Sat, 16 Jun 2012 06:05:25 +0000 (UTC) (envelope-from kob6558@gmail.com) Received: from mail-qc0-f182.google.com (mail-qc0-f182.google.com [209.85.216.182]) by mx1.freebsd.org (Postfix) with ESMTP id C7A3E8FC14 for ; Sat, 16 Jun 2012 06:05:24 +0000 (UTC) Received: by qcsg15 with SMTP id g15so2491647qcs.13 for ; Fri, 15 Jun 2012 23:05:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=CagPj9OZejWwC8JeCl1rNo6keyDyI34UW+IMTBvquhw=; b=kdZaj9ppv6bKvxGEAhPbTK7rl/Jn0XtuWmOis0w8LH1lTIwjlnSjXt84/9WWHBI9Mi xngS1+uRWHZMVsw9kbdOMVssJHQZRAKJg8usVOvR1rfyYKfVU39wYj5oe8/wvqNP61tt YXDhU/Yv4Nl780cThkUfwt/UDWY5gGssB+pUTcAndG6pttJodHGa9KzS4MMAMEUyH3CL 44lIPBLr0CXlaaywJAHuqwZx53BmllXp3BJT2XloDpB9FQVGrICrOjOAnpqNOUmiB0k9 qB4ugyHOVV9LzVjq8oSvfDktzsVaXrNueT7bYmOM0++je8v0Oud7iFJhM5uDgNvZjZBf rxoA== MIME-Version: 1.0 Received: by 10.224.58.137 with SMTP id g9mr15703146qah.83.1339826724046; Fri, 15 Jun 2012 23:05:24 -0700 (PDT) Received: by 10.229.187.5 with HTTP; Fri, 15 Jun 2012 23:05:23 -0700 (PDT) In-Reply-To: References: Date: Fri, 15 Jun 2012 23:05:23 -0700 Message-ID: From: Kevin Oberman To: Ronald Klop Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-stable@freebsd.org Subject: Re: devd problem with 9-stable X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jun 2012 06:05:25 -0000 On Fri, Jun 15, 2012 at 12:13 PM, Ronald Klop wrote: > On Fri, 15 Jun 2012 18:40:45 +0200, Kevin Oberman wro= te: > >> On Fri, Jun 15, 2012 at 7:53 AM, Ronald Klop >> wrote: >>> >>> On Fri, 15 Jun 2012 15:50:49 +0200, Warren Block >>> wrote: >>> >>>> On Fri, 15 Jun 2012, Ronald Klop wrote: >>>> >>>>> On Fri, 15 Jun 2012 08:01:21 +0200, Kevin Oberman >>>>> wrote: >>>>> >>>>>> On Thu, Jun 14, 2012 at 3:11 AM, Ronald Klop >>>>>> wrote: >>>>>>> >>>>>>> >>>>>>> On Thu, 14 Jun 2012 02:41:58 +0200, Kevin Oberman >>>>>>> wrote: >>>>>>> >>>>>>>> Since updating my systems to 9-Stable, I am not getting my smartca= rd >>>>>>>> reader attached when hot-plugged. >>>>>>>> >>>>>>>>> From devd.conf >>>>>>>> >>>>>>>> >>>>>>>> =C2=A0attach 50 { >>>>>>>> =C2=A0 =C2=A0 device-name "ugen[0-9]+"; >>>>>>>> =C2=A0 =C2=A0 match "vendor" "0x0529"; >>>>>>>> =C2=A0 =C2=A0 match "product" "0x0600"; >>>>>>>> =C2=A0 =C2=A0 action "/usr/local/sbin/openct-control attach usb:52= 9/600 usb >>>>>>>> /dev/$dev$ >>>>>>>> }; >>>>>>>> detach 50 { >>>>>>>> =C2=A0 =C2=A0 device-name "ugen[0-9]+"; >>>>>>>> =C2=A0 =C2=A0 match "vendor" "0x0529"; >>>>>>>> =C2=A0 =C2=A0 match "product" "0x0600"; >>>>>>>> =C2=A0 =C2=A0 action "/usr/bin/pkill -fx '/usr/local/sbin/ifdhandl= er -H -p >>>>>>>> [a-z0-9]+ $ >>>>>>>> }; >>>>>>>> =C2=A0If I manually enter the "action" command, it works fine, but= it >>>>>>>> fails >>>>>>>> when I insert the device. It worked fine under version 8. I have >>>>>>>> confirmed devd is seeing the device inserted just fine. the action >>>>>>>> just does not seem to be carried out. >>>>>>>> =C2=A0Any idea where I should look? I saw a couple of threads on c= urrent >>>>>>>> from others seeing something similar, but could find no resolution= . >>>>>>>> I have seen a >>>>>>> >>>>>>> >>>>>>> =C2=A0Did you run devd with debug messages on? Options -D and -d ar= e >>>>>>> helpful. >>>>>>> If you do does devd match the right devd.conf sections and start th= e >>>>>>> action? >>>>>> >>>>>> >>>>>> =C2=A0With debug i get: >>>>>> Processing event '!system=3DUSB subsystem=3DDEVICE type=3DATTACH >>>>>> ugen=3Dugen1.3 cdev=3Dugen1.3 vendor=3D0x0529 product=3D0x0600 devcl= ass=3D0xff >>>>>> devsubclass=3D0x00 sernum=3D"" release=3D0x0100 mode=3Dhost port=3D1 >>>>>> parent=3Dugen1.2' >>>>>> [long list of "Testing" entries, none of which 'vendor' matched] >>>>>> Executing 'logger Unknown USB device: vendor 0x0529 product 0x0600 b= us >>>>>> uhub3' >>>>>> =C2=A0So it looks like devd is not matching the vendor. But my devd.= conf >>>>>> file contains that vendor. I don't know exactly why it is not being >>>>>> tested against. Nothing in the debug output gives me a clue and I >>>>>> tried grepping for one of the tested vendor IDs in /etc/devd.conf an= d >>>>>> /etc/devd/*.conf. =C2=A0Not found. >>>>>> =C2=A0I am at a loss. >>>>> >>>>> >>>>> >>>>> http://www.freebsd.org/releases/9.0R/errata.html >>>>> See point 3 under Open Issues. >>>> >>>> >>>> >>>> Even with those changes, devd is not triggering on my scanner attach: >>>> >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0match "subsystem" "DEVICE"; >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0match "type" "ATTACH"; >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0match "cdev" "ugen[0-9]+.[0-9]+"; >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0match "vendor" "0x04b8"; >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0match "product" "0x010a"; >>>> =C2=A0 =C2=A0 =C2=A0 =C2=A0action "echo HERE! $cdev > /tmp/zoot"; >>>> >>>> # devd -d -D -f /etc/devd/wb.conf >>>> >>>> Processing event '!system=3DUSB subsystem=3DDEVICE type=3DATTACH ugen= =3Dugen0.6 >>>> cdev=3Dugen0.6 vendor=3D0x04b8 product=3D0x010a devclass=3D0xff devsub= class=3D0xff >>>> sernum=3D"" release=3D0x0103 mode=3Dhost port=3D4 parent=3Dugen0.4' >>>> Pushing table >>>> setting system=3DUSB >>>> setting subsystem=3DDEVICE >>>> setting type=3DATTACH >>>> setting ugen=3Dugen0.6 >>>> setting cdev=3Dugen0.6 >>>> setting vendor=3D0x04b8 >>>> setting product=3D0x010a >>>> setting devclass=3D0xff >>>> setting devsubclass=3D0xff >>>> setting sernum=3D >>>> setting release=3D0x0103 >>>> setting mode=3Dhost >>>> setting port=3D4 >>>> setting parent=3Dugen0.4 >>>> Processing notify event >>>> Testing system=3DUSB against ^DEVFS >>>> Testing system=3DUSB against ^DEVFS >>>> Popping table >>>> >>> >>> I tried the same attaching my webcam on pcbsd in vmware. >>> >>> [root@pcbsd-1684 /etc/devd]# cat /tmp/bla.conf >>> notify 100 { >>> >>> =C2=A0match "subsystem" "DEVICE"; >>> =C2=A0match "type" "ATTACH"; >>> =C2=A0match "cdev" "ugen[0-9]+.[0-9]+"; >>> =C2=A0match "vendor" "0x2232"; >>> =C2=A0match "product" "0x1008"; >>> =C2=A0action "echo HERE! $cdev >> /tmp/bla.log"; >>> =C2=A0}; >>> >>> # devd -d -D -f /tmp/bla.conf >>> ... >>> Processing event '!system=3DUSB subsystem=3DDEVICE type=3DATTACH ugen= =3Dugen1.2 >>> cdev=3Dugen1.2 vendor=3D0x2232 product=3D0x1008 devclass=3D0xef devsubc= lass=3D0x02 >>> sernum=3D"" release=3D0x0019 mode=3Dhost port=3D1 parent=3Dugen1.1' >>> >>> =C2=A0Pushing table >>> setting system=3DUSB >>> setting subsystem=3DDEVICE >>> setting type=3DATTACH >>> setting ugen=3Dugen1.2 >>> setting cdev=3Dugen1.2 >>> setting vendor=3D0x2232 >>> setting product=3D0x1008 >>> setting devclass=3D0xef >>> setting devsubclass=3D0x02 >>> =C2=A0setting sernum=3D >>> setting release=3D0x0019 >>> setting mode=3Dhost >>> setting port=3D1 >>> setting parent=3Dugen1.1 >>> Processing notify event >>> Testing subsystem=3DDEVICE against ^DEVICE >>> Testing type=3DATTACH against ^ATTACH >>> Testing cdev=3Dugen1.2 against ^ugen[0-9]+.[0-9]+ >>> =C2=A0Testing vendor=3D0x2232 against ^0x2232 >>> Testing product=3D0x1008 against ^0x1008 >>> Executing 'echo HERE! ugen1.2 >> /tmp/bla.log' >>> Popping table >>> >>> [root@pcbsd-1684 /etc/devd]# cat /tmp/bla.log >>> HERE! ugen1.2 >>> >>> Do you see a significant difference with your setup? >> >> >> Switched to 'notify' with: >> notify 50 { >> =C2=A0 =C2=A0 =C2=A0 =C2=A0match "system" "USB" >> =C2=A0 =C2=A0 =C2=A0 =C2=A0match "subsystem" "DEVICE"; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0match "type" "ATTACH"; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0match "cdev" "ugen[0-9\.]+"; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0match "vendor" "0x0529"; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0match "product" "0x0600"; >> =C2=A0 =C2=A0 =C2=A0 =C2=A0action "/usr/local/sbin/openct-control attach= usb:529/600 usb >> /dev/$devi >> ce-name"; >> }; >> >> I still see no attempt to match against vendor 0x0529. Still no go. >> (Note that I prefer the [0-9\.] + syntax, but tried yours, as well.) >> >> The real issue is that devd seems to have a long list of vendors that >> it matches against, but 0x529 is not in that list, so matching the >> device name is not likely an issue. > > > You miss a ; after "USB" and I don't think $device-name is still used. It= is > replaced with $cdev and $ugen according to the 9.0 errata. > > http://www.freebsd.org/releases/9.0R/errata.html > > And it should not be necessary to escape a . within a set of characters i= n a > regular expression. But I don't now the internals of devd and if it reall= y > uses regular expressions. > > NB: it can help if you post the debug output from devd online somewhere. = So > people can have a look at the output of devd in stead of guessing from th= e > syntax of the config. > > Succes, Thanks for the pointer to the errata! That did the trick for the attach.I now need to deal with the slightly more complex detach action. It includes backticks, so I now need to read the other half of this thread. Thanks again, Ron. No excuse for not carefully reading the errata, but I di= dn't. --=20 R. Kevin Oberman, Network Engineer E-mail: kob6558@gmail.com