From: Harald Hoyer <harald@redhat.com>
To: linux-hotplug@vger.kernel.org
Subject: Re: Run script when USB scanner unplugged
Date: Thu, 03 Jun 2004 08:34:03 +0000 [thread overview]
Message-ID: <40BEE27B.60306@redhat.com> (raw)
In-Reply-To: <40BE3850.8070106@comcast.net>
[-- Attachment #1: Type: text/plain, Size: 1406 bytes --]
Ian Pilcher wrote:
> 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!
>
Install the FC2 udev rpm... read the manpage and add a *.rule file to
/etc/udev/rules.d . Also add your scanner to /etc/security/console.perms
(man 5 console.perms).
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
next prev parent reply other threads:[~2004-06-03 8:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-02 20:28 Run script when USB scanner unplugged Ian Pilcher
2004-06-03 8:34 ` Harald Hoyer [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=40BEE27B.60306@redhat.com \
--to=harald@redhat.com \
--cc=linux-hotplug@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).