From owner-freebsd-questions@FreeBSD.ORG Sun Oct 2 03:51:35 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2B4431065673 for ; Sun, 2 Oct 2011 03:51:35 +0000 (UTC) (envelope-from mapsware@prodigy.net.mx) Received: from nlpiport16.prodigy.net.mx (nlpiport16.prodigy.net.mx [148.235.52.21]) by mx1.freebsd.org (Postfix) with ESMTP id EAD558FC12 for ; Sun, 2 Oct 2011 03:51:34 +0000 (UTC) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqkGAN7ah069qoS+/2dsb2JhbAAnGplpjkyCWAEBBYEJCxguV4gaJI0bqRUOhxMEh0cwnUc X-IronPort-AV: E=Sophos;i="4.68,476,1312174800"; d="scan'208";a="478068616" Received: from nlpiport02.prodigy.net.mx ([148.235.52.117]) by nlpiport16.prodigy.net.mx with ESMTP; 01 Oct 2011 22:34:50 -0500 Received: from dsl-189-170-132-190-dyn.prod-infinitum.com.mx (HELO morena) ([189.170.132.190]) by nlpiport02.prodigy.net.mx with ESMTP; 01 Oct 2011 22:34:51 -0500 From: Martin Alejandro Paredes Sanchez To: freebsd-questions@freebsd.org Date: Sat, 1 Oct 2011 20:35:05 -0700 User-Agent: KMail/1.9.10 References: <20110924100418.50edc7ea@atomizer> In-Reply-To: <20110924100418.50edc7ea@atomizer> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201110012035.05248.mapsware@prodigy.net.mx> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: Help with devd.conf X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Oct 2011 03:51:35 -0000 On Saturday 24 September 2011 07:04:18 Rod Person wrote: > I'm trying to understand devd.conf to auto mount usb devices. For > example I have a usb drive that will show up as da1 so as a test I just > want to write something to syslog when it is plugged in. > > This is what I have tried in devd.conf: > > notify 20{ > match "system" "DEVFS"; > match "subsystem" "CDEV"; > match "type" "CREATE"; > match "cdev" "da[1-9]+"; > action "logger you plugged in some usb device"; > }; > > notify 20{ > match "system" "USB"; > match "subsytem" "DEVICE"; > match "type" "ATTACH"; > action "logger some type of usb thing attached"; > }; > I do not belive that the values of that variables are in upper case To see what is happening in devd, try this Create the file /usr/local/etc/devd/printvar.conf with ============================= # # Run devd in debug mode # devd -Dd # attach 0 { device-name "umass[0-9]+"; action "/usr/local/etc/devd/printvar.sh '$bus' '$cdev' '$cisproduct' '$cisvendor' '$class' '$device' '$device-name' '$function' '$manufacturer' '$notify' '$product' '$serial' '$slot' '$subvendor' '$subdevice' '$subsystem' '$system' '$type' '$vendor'"; }; ============================= Also, creat the file Create the file /usr/local/etc/devd/printvar.sh ============================= #!/bin/sh { echo "$# parametros" echo $@ echo "bus = $1" echo "cdev = $2" echo "cisproduct = $3" echo "cisvendor = $4" echo "class = $5" echo "device = $6" echo "device-name = $7" echo "function = $8" echo "manufacturer = $9" shift 9 echo "notify = $1" echo "product = $2" echo "serial = $3" echo "slot = $4" echo "subvendor = $5" echo "subdevice = $6" echo "subsystem = $7" echo "system = $8" echo "type = $9" shift 1 echo "vendor = $9" } > /tmp/VariablesDevd.txt ============================= Check the content of /tmp/VariablesDevd.txt You can also try this other advise for auto mount http://networking.ringofsaturn.com/Unix/freebsdautomount.php