From owner-freebsd-questions@FreeBSD.ORG Sat Jun 4 22:19:01 2011 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 80F27106566B for ; Sat, 4 Jun 2011 22:19:01 +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 2ACCA8FC14 for ; Sat, 4 Jun 2011 22:19:00 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.4/8.14.4) with ESMTP id p54MJ0qU034280; Sat, 4 Jun 2011 16:19:00 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.4/8.14.4/Submit) with ESMTP id p54MJ0lR034277; Sat, 4 Jun 2011 16:19:00 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Sat, 4 Jun 2011 16:19:00 -0600 (MDT) From: Warren Block To: Scott Gasch In-Reply-To: Message-ID: References: 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]); Sat, 04 Jun 2011 16:19:00 -0600 (MDT) Cc: questions@freebsd.org Subject: Re: Usb printers take the same port deterministically? 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: Sat, 04 Jun 2011 22:19:01 -0000 On Sat, 4 Jun 2011, Scott Gasch wrote: > Hi, > > I have two usb printers on my freebsd machine and I'm using cups. One of > the things I've done is publish a raw (no driver) printer for each of them > and use that to share them with other machines in the house that have > drivers. > > My problem is that every once in a while, when I boot up, the order of the > printers on the usb ports seems to change. For example, right now I've got: > > Jun 4 11:24:34 foo kernel: ulpt0: 2.00/1.00, addr 2> on uhub1 > Jun 4 11:24:34 foo kernel: ulpt0: using bi-directional mode > Jun 4 11:28:13 foo kernel: ulpt1: 0/0, rev 2.00/1.00, addr 2> on uhub7 > > > But when I lost power the other night the machine came up with them reversed > -- the brother on ulpt1 and the epson on ulpt0. > > As far as I can tell, cups printers.conf ties to a particular port. So, you > can probably see where this is going... when they bind in the wrong order > and someone prints I get a ton of crap printed out and waste a ton of paper. > How can I make it so that a particular printer binds to a particular usb > port deterministically? devd.conf. But I don't think there's any control over ulpt. Instead, maybe create links so /dev/ulpt-hl2140 and /dev/ulpt-epson12 are linked to the right devices, and use those where static devices are needed. Untested... attach 20 { device-name "ulpt[0-9]"; match "vendor" "0x1234"; # Brother match "product" "0x4321"; # HL-2140 action "ln -s /dev/$device-name /dev/ulpt-hl2140"; }; detach 20 { device-name "ulpt[0-9]"; match "vendor" "0x1234"; # Brother match "product" "0x4321"; # HL-2140 action "rm /dev/ulpt-hl2140"; };