FC3 hotswap problems with USB devices.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


I am currently using Fedora Core 3 with kernel 2.6.12-1.1372_FC3 on an
i686, which runs as a server in text mode (init 3).

Recently I added a smartcard reader and an UPS (both USB) to the server
and they work fine.  However, the default permissions are a nuisance; I
would like the smartcard reader accessible to all, not just root, and
the monitoring software for the UPS to run unpriveleged.

Consequently, I created the following files in /etc/hotplug/usb:

/etc/hotplug/usb/usbups
#!/bin/bash
# Implementation by Wolfgang Ocker
#
# /etc/hotplug/usb/usbups
#
# Sets up newly plugged in USB USP
#
# In the usermap file, the first field "usb module" should be named
# "usbups" like this script.
#
echo usbups: device = $DEVICE >>/tmp/usb.log

NUTOWNER=nut

if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
    chmod 0000 "${DEVICE}"
    chown "$NUTOWNER" "${DEVICE}"
    chmod 0644 "${DEVICE}"
fi


/etc/hotplug/usb/usbups.usermap

# usb module         match_flags idVendor idProduct bcdDevice_lo
bcdDevice_hi bD
eviceClass bDeviceSubClass bDeviceProtocol bInterfaceClass
bInterfaceSubClass bI
nterfaceProtocol driver_info
# Powerware USB
usbups  0x0003  0x0592  0x0002   0 0 0 0 0x00 0x00 0x00 0x00 0x00000000


/etc/hotplug/usb/gnupg-ccid
#!/bin/bash
#
# taken from libgphoto2
#
# Sets up newly plugged in card reader so that only members of the
# group can access it

GROUP=scard

# can access it from user space. (Replace scard with the name of the
# group you want to have access to the card reader.)
#
# Note that for this script to work, you'll need all of the following:
# a) a line in the file /etc/hotplug/gnupg-ccid.usermap that corresponds
#    to the card reader you are using.
# b) a group "scard" where all users allowed access to the
#    card reader are listed
# c) a Linux kernel supporting hotplug and usbdevfs
# d) the hotplug package (http://linux-hotplug.sourceforge.net/)
#
# In the usermap file, the first field "usb module" should be named
# "gnupg-ccid" like this script.
#
if [ "${ACTION}" = "add" ] && [ -f "${DEVICE}" ]
then
    chmod o-rwx "${DEVICE}"
    chgrp "${GROUP}" "${DEVICE}"
    chmod g+rw "${DEVICE}"
fi


/etc/hotplug/usb/gnupg-ccid.usermap
#           flags   V       P     Bcd C S Prot Clas Sub  Prot Info
# Generic CCID device
gnupg-ccid  0x0080  0x0    0x0    0 0 0 0 0x00 0x0B 0x00 0x00 0x00000000


These files are readable by all and the scripts are executable by all.
I know that the usbups at least should work as the scripts were written
by someone with FC3 and FC4 machines.

The scripts do not appeared to be triggered - there are no log entries
relating to hotplug and the permissions remain the same.  In addition,
there is no output to the log file as per the usbups file.

Furthermore, the vendor and product codes are correct for the UPS, and
the interface class code correct for the smartcard reader:

Bus 005 Device 004: ID 0592:0002 Powerware Corp.
Bus 002 Device 002: ID 04e6:5113 SCM Microsystems, Inc.
[...]   bInterfaceClass        11 Chip/SmartCard


I just can't figure out why these scripts aren't being executed -
particularly as the usbups one was written on a FC3 machine - and should
be very grateful for any help.


Take care,

- --
Benjamin
benjamin@xxxxxxxxxxxxxxxxxxxx
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQIVAwUBQwfIE+gNmph0Y1E2AQKHfg/9EA5VgnHOOHJwzfR7akLSonGQ+Nm5sALu
2+8EwMitpdhmfjqjogve9qJWOCzzWWb6w/2jXAZ1CbBbp0J+YwlEf3Q21eatJ/6C
mkE8iM6GUEAQNMlrrkqVEjyeyU7CpkSk+Mv58XmZOOh5OMWlMqvarkNTXWyKtXrg
TBMLScfEj1rpKoO3PcbsectuJbSLWXy1/hIusB+IDV6hKou5IDWXV+zVBXPa4JwG
e6MgkOZp7QiCN0WwNSBfF1TR0eoKfgKrdLNa/ydMSQji5+wJx9xi1AilTASm2X9q
Bbwkrql09tCPevvirdUo3t/UzZsRQnfRhK3c9HFZgw+m5JUYGuTjT0GwoIqRUgkN
/lKhRKMMq71mn7XrUMpEbPZfcg7rSwJjrt9q4nLRJqnad26InQTarfmARQ9/Jmht
zgA6EXUuRz61BDCR5i/CaCgWKjdGYdYWQFhBYJSMhSLgSRcswqgYdnbbfAc9dI8Y
kUVDRZ0evjIFVdjeIqhWxeOadikmHD9PyNQ/uy4CDT72+/G3eN9MCU6P/qB4kG/1
gAdPbahcg7YeHvbbf9qqqsSXXBwDCAeEHhfAd9lbH+sirKmwKeLBfgE/Cy9r7xY+
rHtbPP61udnO4FAKDG1IyE21raO61Xv1Lwxm8DcWzcPoXA4PY4+wk9uKeSTOqHVJ
ZmG3OYx6Z2k=
=DxA7
-----END PGP SIGNATURE-----


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux