From owner-freebsd-stable@FreeBSD.ORG Fri Jun 15 17:21:03 2012 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 83361106582E for ; Fri, 15 Jun 2012 17:21:03 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 3FD168FC19 for ; Fri, 15 Jun 2012 17:21:03 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id q5FHL2mr027488; Fri, 15 Jun 2012 11:21:02 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id q5FHL29S027485; Fri, 15 Jun 2012 11:21:02 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Fri, 15 Jun 2012 11:21:02 -0600 (MDT) From: Warren Block To: Oliver Fromme In-Reply-To: <201206151433.q5FEXJC6073094@lurza.secnetix.de> Message-ID: References: <201206151433.q5FEXJC6073094@lurza.secnetix.de> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Fri, 15 Jun 2012 11:21:02 -0600 (MDT) 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: Fri, 15 Jun 2012 17:21:03 -0000 On Fri, 15 Jun 2012, Oliver Fromme wrote: > Warren Block wrote: > > [...] > > > > > > attach 50 { > > [...] > > > > Even with those changes, devd is not triggering on my scanner attach: > > > > match "subsystem" "DEVICE"; > > match "type" "ATTACH"; > > match "cdev" "ugen[0-9]+.[0-9]+"; > > match "vendor" "0x04b8"; > > match "product" "0x010a"; > > action "echo HERE! $cdev > /tmp/zoot"; > > Have you tried to put those lines inside a "notify" block > instead of an "attach" block? The documentation is not > very clear about the difference between an "attach" block > an a "notify" block with $type=ATTACH, but it probably > wouldn't hurt to try both. Well, it did work with an attach event. Progress: the event is seen with a notify event. However, something is not right with the execution of backticks in the action string: notify 20 { match "subsystem" "DEVICE"; match "type" "ATTACH"; match "cdev" "ugen[0-9]+.[0-9]+"; match "vendor" "0x04b8"; match "product" "0x010a"; action "devnum=`echo $cdev | sed -e 's/^ugen//'` && \ echo $devnum > /tmp/example && \ echo $cdev >> /tmp/example"; }; When the event is seen: Executing 'devnum=`echo ugen0.6 | sed -e 's/^ugen//'` && echo devnum: > /tmp/example && echo cdev: ugen0.6 >> /tmp/example' $devnum never gets a value, the contents of /tmp/example are: devnum: cdev: ugen0.6 Trying $() instead of backticks makes it worse: Executing 'devnum=$(echo $cdev | sed -e 's/^ugen//') && echo devnum: $devnum > /tmp/example && echo cdev: $cdev >> /tmp/example' /tmp/example is then: devnum: cdev: