From owner-freebsd-questions@FreeBSD.ORG Sat Jan 26 22:41:39 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 25F3E5CF for ; Sat, 26 Jan 2013 22:41:39 +0000 (UTC) (envelope-from FreeBSD@shaneware.biz) Received: from ipmail05.adl6.internode.on.net (ipmail05.adl6.internode.on.net [IPv6:2001:44b8:8060:ff02:300:1:6:5]) by mx1.freebsd.org (Postfix) with ESMTP id 8DF1B259 for ; Sat, 26 Jan 2013 22:41:38 +0000 (UTC) Received: from ppp247-71.static.internode.on.net (HELO leader.local) ([203.122.247.71]) by ipmail05.adl6.internode.on.net with ESMTP; 27 Jan 2013 09:11:35 +1030 Message-ID: <51045B48.40202@ShaneWare.Biz> Date: Sun, 27 Jan 2013 09:10:08 +1030 From: Shane Ambler User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: dweimer@dweimer.net Subject: Re: Locking USB Serial Device to Specific Com port References: <762f51b7c30dd5c920788336b3eb4fa5@dweimer.net> In-Reply-To: <762f51b7c30dd5c920788336b3eb4fa5@dweimer.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: FreeBSD Questions X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Jan 2013 22:41:39 -0000 On 27/01/2013 08:15, dweimer wrote: > I would like to lock down the USB serial port adapter used on the UPS to > /dev/cuaU0, to make sure the UPS is always monitored and I will get a > clean shutdown in event of a power failure. > > I believe that this requires setting a hint line of some sort in the > /boot/loader.conf file, but I am having trouble tracking down what this > should be, or maybe I am on the wrong track. Here is the current > information from the adpapters, the UPS adapter was connected at boot, > is on /dev/cuaU0, the other one was plugged in after boot, and is on > /dev/cuaU1. start with man devd.conf You can add your own devd files in /usr/local/etc/devd/ Something along the lines of - attach 200 { device-name "cuaU[0-9]+"; match "vendor" "0x067b"; match "product" "0x2303"; action "sleep 2; cd /dev; ln -s ${device-name} upsmonitor"; }; use usbconfig to get info. I am thinking with the similarity of the two you may need to rely on bus and hubaddr or devaddr to keep each device identified by usb port location.