Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
udev creates device node for printer with wrong gid
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
maltinator
n00b
n00b


Joined: 14 Jan 2004
Posts: 50
Location: Aachen, Germany

PostPosted: Mon Jan 12, 2009 11:19 am    Post subject: udev creates device node for printer with wrong gid Reply with quote

hi everybody,

I have a problem with my usb printer

Code:
# ls -l /dev/usb/lp0
crw-rw---- 1 root plugdev 180, 0 12. Jan 2009  /dev/usb/lp0


it's owned by root:plugdev, but should be owned by root:lp. with root:plugdev i am not allowed to print, if i change it to root:lp everything works fine

i never knew much about udev so i read some tutorials how it works and i guess i understood it in a good way.

so the following rules from /etc/udev/rules.d should take care of my printer

Code:
SUBSYSTEM=="usb",      KERNEL=="lp*", NAME="usb/%k", SYMLINK+="usb%k", GROUP="lp"
KERNEL=="lp[0-9]*",      GROUP="lp", SYMLINK+="par%n"


looks good. the only udev rules that change usergroup to "plugdev" are in .../rules.d/70-libgphoto2.rules and do -of course- not apply to my printer

so i tried udevadm test

Code:
# udevadm test /class/usb/lp0
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.

parse_file: reading '/dev/.udev/rules.d/10-root-link.rules' as rules file
parse_file: reading '/etc/udev/rules.d/30-kernel-compat.rules' as rules file
parse_file: reading '/etc/udev/rules.d/30-svgalib.rules' as rules file
parse_file: reading '/etc/udev/rules.d/40-alsa.rules' as rules file
parse_file: reading '/etc/udev/rules.d/40-gentoo.rules' as rules file
parse_file: reading '/etc/udev/rules.d/40-video.rules' as rules file
parse_file: reading '/etc/udev/rules.d/50-udev-default.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-cdrom_id.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-input.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-storage-tape.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-persistent-storage.rules' as rules file
parse_file: reading '/etc/udev/rules.d/61-persistent-storage-edd.rules' as rules file
parse_file: reading '/etc/udev/rules.d/64-device-mapper.rules' as rules file
parse_file: reading '/etc/udev/rules.d/65-permissions.rules' as rules file
parse_file: reading '/etc/udev/rules.d/70-libgphoto2.rules' as rules file
parse_file: reading '/etc/udev/rules.d/70-persistent-cd.rules' as rules file
parse_file: reading '/etc/udev/rules.d/70-persistent-net.rules' as rules file
parse_file: reading '/etc/udev/rules.d/75-cd-aliases-generator.rules' as rules file
parse_file: reading '/etc/udev/rules.d/75-persistent-net-generator.rules' as rules file
parse_file: reading '/etc/udev/rules.d/80-drivers.rules' as rules file
parse_file: reading '/etc/udev/rules.d/90-hal.rules' as rules file
parse_file: reading '/etc/udev/rules.d/90-network.rules' as rules file
parse_file: reading '/etc/udev/rules.d/95-udev-late.rules' as rules file
parse_file: reading '/etc/udev/rules.d/99-fuse.rules' as rules file
parse_file: reading '/etc/udev/rules.d/kino.rules' as rules file
import_uevent_var: import into environment: 'MAJOR=180'
import_uevent_var: import into environment: 'MINOR=0'
import_uevent_var: import into environment: 'PHYSDEVPATH=/devices/pci0000:00/0000:00:10.0/usb2/2-1/2-1:1.0'
import_uevent_var: import into environment: 'PHYSDEVBUS=usb'
import_uevent_var: import into environment: 'PHYSDEVDRIVER=usblp'
udevtest: looking at device '/class/usb/lp0' from subsystem 'usb'
udev_rules_get_name: add symlink 'usblp0'
udev_rules_get_name: rule applied, 'lp0' becomes 'usb/lp0'
udev_rules_get_name: add symlink 'par0'
run_program: 'check-ptp-camera 06/01/01'
run_program: '/lib/udev/check-ptp-camera' returned with status 1
udev_device_event: device '/class/usb/lp0' already in database, cleanup
udev_node_add: creating device node '/dev/usb/lp0', major=180, minor=0, mode=0660, uid=0, gid=1003
udev_node_update_symlinks: update symlink 'usblp0' of '/class/usb/lp0'
udev_db_get_devices_by_name: found index directory '/dev/.udev/names/usblp0'
update_link: found 1 devices with name 'usblp0'
update_link: found '/class/usb/lp0' for 'usblp0'
update_link: compare (our own) priority of '/class/usb/lp0' 0 >= 0
update_link: 'usblp0' with target 'usb/lp0' has the highest priority 0, create it
udev_node_update_symlinks: update symlink 'par0' of '/class/usb/lp0'
udev_db_get_devices_by_name: found index directory '/dev/.udev/names/par0'
update_link: found 1 devices with name 'par0'
update_link: found '/class/usb/lp0' for 'par0'
update_link: compare (our own) priority of '/class/usb/lp0' 0 >= 0
update_link: 'par0' with target 'usb/lp0' has the highest priority 0, create it
udevtest: run: 'socket:/org/freedesktop/hal/udev_event'
udevtest: run: 'socket:@/org/kernel/udev/monitor'


looks as it should. so why ist /dev/usb/lp0 owned by plugdev?

thanks

malte


Last edited by maltinator on Wed Jan 14, 2009 12:11 pm; edited 1 time in total
Back to top
View user's profile Send private message
gentoo_ram
Guru
Guru


Joined: 25 Oct 2007
Posts: 474
Location: San Diego, California USA

PostPosted: Tue Jan 13, 2009 1:07 am    Post subject: Reply with quote

Hmmm, check /etc/group. See if plugdev and lp happen to have the same GID.
Back to top
View user's profile Send private message
maltinator
n00b
n00b


Joined: 14 Jan 2004
Posts: 50
Location: Aachen, Germany

PostPosted: Tue Jan 13, 2009 9:52 am    Post subject: Reply with quote

thanks for your idea but they have not ...

Code:
lp:x:7:lp [...]
plugdev:x:1003:haldaemon


so ... could it be a problem with the haldaemon?

malte


Last edited by maltinator on Tue Jan 13, 2009 10:14 am; edited 1 time in total
Back to top
View user's profile Send private message
maltinator
n00b
n00b


Joined: 14 Jan 2004
Posts: 50
Location: Aachen, Germany

PostPosted: Tue Jan 13, 2009 10:13 am    Post subject: Reply with quote

okay hald is never startet ... this is # ls /etc/runlevels/boot

Code:
bootmisc  checkroot  consolefont        hostname  localmount  net.lo     urandom  checkfs   clock      hibernate-cleanup  keymaps   modules     rmnologin


and here # ls /etc/runlevels/default
Code:
alsasound  cupsd     lm_sensors  netmount    sshd       vsftpd  boinc      iptables  local       ntp-client  syslog-ng


so no hald ... strange ... anyone ideas?

thanks

malte
Back to top
View user's profile Send private message
DirtyHairy
l33t
l33t


Joined: 03 Jul 2006
Posts: 608
Location: Würzburg, Deutschland

PostPosted: Tue Jan 13, 2009 10:51 am    Post subject: Reply with quote

Code:
udev_node_add: creating device node '/dev/usb/lp0', major=180, minor=0, mode=0660, uid=0, gid=1003
This looks like udev (at least in the simulation run) is creating the node as belonging to plugdev, so it looks like an udev problem to me.
Back to top
View user's profile Send private message
maltinator
n00b
n00b


Joined: 14 Jan 2004
Posts: 50
Location: Aachen, Germany

PostPosted: Wed Jan 14, 2009 12:10 pm    Post subject: Reply with quote

uhm ... thank you! I thought I checked for that ... but somehow I didn't see that

But why is the node with the wrong gid created?

this rule
Code:
SUBSYSTEM=="usb",      KERNEL=="lp*", NAME="usb/%k", SYMLINK+="usb%k", GROUP="lp"

is obviously applied, as otherwise no /dev/usb/lp0 would exist ...

and I do not find any other rules from higher priority files that would apply to my printer

(namely in theese files
parse_file: reading '/dev/.udev/rules.d/10-root-link.rules' as rules file
parse_file: reading '/etc/udev/rules.d/30-kernel-compat.rules' as rules file
parse_file: reading '/etc/udev/rules.d/30-svgalib.rules' as rules file
parse_file: reading '/etc/udev/rules.d/40-alsa.rules' as rules file
parse_file: reading '/etc/udev/rules.d/40-gentoo.rules' as rules file
parse_file: reading '/etc/udev/rules.d/40-video.rules' as rules file)

still in need for some help!

malte
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum