Help with devd.conf
Martin Alejandro Paredes Sanchez
mapsware at prodigy.net.mx
Sun Oct 2 03:51:35 UTC 2011
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
More information about the freebsd-questions
mailing list