linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Run script when USB scanner unplugged
@ 2004-06-02 20:28 Ian Pilcher
  2004-06-03  8:34 ` Harald Hoyer
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Ian Pilcher @ 2004-06-02 20:28 UTC (permalink / raw)
  To: linux-hotplug

Running Fedora Core 2 here.  I've found that the hotplug scripts shipped
with the distribution do a fine job of setting the permissions when a
USB scanner is plugged in *after* a user has logged in.  Unfortunately,
this is not the most common usage scenario; I leave my scanner plugged
in pretty much all the time, and I suspect that most other users do the
same.

What's needed, at least on Red Hat/Fedora Core systems, is a symlink
which will tell PAM to adjust the permissions when a "console" user logs
in.  I've hacked /etc/hotplug/usb/libusbscanner to do the following when
a scanner is plugged in:

     DEVID="${REMOVER#/var/run/usb/}"
     rm -f "/dev/usb/scanner-${DEVID}"
     ln -s "${DEVICE}" "/dev/usb/scanner-${DEVID}"

So far so good.  The link is created when the system boots, and PAM
follows it and sets the device permissions properly when a "console
user" logs in.

Now I want to remove the link when (if) the scanner is unplugged.  I've
tried adding an 'if [ "${ACTION}" = "remove ]' section to
/etc/hotplug/usb/libusbscanner, but that script doesn't appear to get
executed when a USB scanner is unplugged.

What do I need to do?

Thanks!

-- 
====================================
Ian Pilcher                                        i.pilcher@comcast.net
====================================



-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2004-06-08  0:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-02 20:28 Run script when USB scanner unplugged Ian Pilcher
2004-06-03  8:34 ` Harald Hoyer
2004-06-03 17:36 ` Ian Pilcher
2004-06-04 13:55 ` Ian Pilcher
2004-06-04 17:07 ` Bertrik Sikken
2004-06-04 21:13 ` Greg KH
2004-06-05 16:01 ` Ian Pilcher
2004-06-05 16:05 ` Greg KH
2004-06-05 17:35 ` Ian Pilcher
2004-06-05 17:36 ` Ian Pilcher
2004-06-05 18:26 ` Bertrik Sikken
2004-06-08  0:30 ` Marcelo Ricardo Leitner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).