Re: [Freebsd 9] [amd64] [USB] [HPLIP] what's the (new) right way to manage hplip usb-plugged printers, running Freebsd 9

2011-10-30 Thread Hans Petter Selasky
On Sunday 30 October 2011 01:31:21 Daniel O'Connor wrote:
 I'm not sure what would load it automatically - it may be built into the
 kernel though. Anyway, as you say it should work with ulpt loaded anyway.

Hi,

ulpt is autoloaded by /etc/devd/usb.conf

--HPS
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: [Freebsd 9] [amd64] [USB] [HPLIP] what's the (new) right way to manage hplip usb-plugged printers, running Freebsd 9

2011-10-29 Thread Jilles Tjoelker
On Sat, Oct 29, 2011 at 04:10:46PM +0200, David Marec wrote:
 So, what's should be the news groupuser's rights required by HPLIP/cups 
 on FreeBSD 9 ?

 And, how to handle them with devd ?

Use devfs rules.

Pasting from http://www.stack.nl/~jilles/unix/freebsd-devfs.txt

Create or edit /etc/devfs.rules and put something like this in it:

[devfsrules_mybox=10]
add path 'fd0*' mode 660

See man 8 devfs for more information.

Then put in /etc/rc.conf

devfs_system_ruleset=devfsrules_mybox

If you want to edit other /dev mountpoints (e.g. for jails) use
something like

devfs_set_rulesets=/usr/jails/jail1/dev=devfsrules_jail1 
/usr/jails/jail2/dev=devfsrules_jail2

-- 
Jilles Tjoelker
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: [Freebsd 9] [amd64] [USB] [HPLIP] what's the (new) right way to manage hplip usb-plugged printers, running Freebsd 9

2011-10-29 Thread Patrick Lamaiziere
Le Sat, 29 Oct 2011 21:58:53 +0200,
Jilles Tjoelker jil...@stack.nl a écrit :

 On Sat, Oct 29, 2011 at 04:10:46PM +0200, David Marec wrote:
  So, what's should be the news groupuser's rights required by
  HPLIP/cups on FreeBSD 9 ?
 
  And, how to handle them with devd ?
 
 Use devfs rules.
 
 Pasting from http://www.stack.nl/~jilles/unix/freebsd-devfs.txt
 
 Create or edit /etc/devfs.rules and put something like this in it:
 
 [devfsrules_mybox=10]
 add path 'fd0*' mode 660

The problem is that the printer appears as ugenXXX.Y, but other usb
devices (disk, usb-key, ...) also have an entry in /dev/ugen/

You really don't want to allow the users to access these devices, but
*only* the printer. This is why we use a devd rule that test the type
of the device. I don't think we can do this with devfs.

And the ugen number differs if the usb port is not always the same.

Regards.
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: [Freebsd 9] [amd64] [USB] [HPLIP] what's the (new) right way to manage hplip usb-plugged printers, running Freebsd 9

2011-10-29 Thread Daniel O'Connor

On 30/10/2011, at 24:40, David Marec wrote:
 But, now running FreeBSD 9, I get new usb/devd behavior issues.
 
 First, the ulpt module is always loaded. Is there any elegant way to get rid 
 of this 'self loading' behavior, except to remove it from /boot/modules ?
 Anyway, it sounds like HPLIP is now working with the ulpt module loaded.

I'm not sure what would load it automatically - it may be built into the kernel 
though. Anyway, as you say it should work with ulpt loaded anyway.

 But, devd never sets the suitable rights on ugen.
 
 Moreover, switching to the  'action' that only logs something, reveals that 
 devd never executes this entry.
 
 
 So, what's should be the news groupuser's rights required by HPLIP/cups on 
 FreeBSD 9 ?
 
 And, how to handle them with devd ?

I have a similar problem..

Looking at /etc/devd/uath.conf I see..
notify 100 {
match system  USB;
match subsystem   DEVICE;
match typeATTACH;
match vendor  0x168c;
match product 0x0002;
action /usr/sbin/uathload -d /dev/$cdev;
};

Also, I have devd entries for NUT (UPS software) which look like so..
attach 100 {
match vendor  0x0463;
match product 0x;
action chown :uucp /dev/$device-name; chmod 660 /dev/$device-name;
};

However this doesn't seem to work anymore, it certainly used to.. :(

I tried adding the system, subsystem  type parts and changing device-name to 
cdev but no luck..

I ran devd -Dd and checked the output but while it says it parses nut.conf it 
doesn't seem to match the entries.

devd output looks like so..

Processing event '!system=USB subsystem=DEVICE type=ATTACH ugen=ugen1.3 
cdev=ugen1.3 vendor=0x046
3 product=0x devclass=0x00 devsubclass=0x00 sernum=0 
release=0x4241 mode=host port=
3 parent=ugen1.1'
Pushing table
setting system=USB
setting subsystem=DEVICE
setting type=ATTACH
setting ugen=ugen1.3
setting cdev=ugen1.3
setting vendor=0x0463
setting product=0x
setting devclass=0x00
setting devsubclass=0x00
setting sernum=0
setting release=0x4241
setting mode=host
setting port=3
setting parent=ugen1.1
Processing notify event

--
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
The nice thing about standards is that there
are so many of them to choose from.
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C






___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org