Bug 1248074 - [RFE] user-specific udev rules
[RFE] user-specific udev rules
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2015-07-29 10:31 EDT by Jan Pokorný
Modified: 2015-07-30 11:15 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-07-29 14:00:45 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Sample implementation of solution #2. (2.33 KB, application/x-shellscript)
2015-07-30 11:15 EDT, Jan Pokorný
no flags Details

  None (edit)
Description Jan Pokorný 2015-07-29 10:31:28 EDT
Use case:

I want to be able to specify within my user account that custom
setxkbmap/xkbcomp commands shall be run when I connect a specific
keyboard to the machine.

Currently I can see two suboptimal alternatives:

1. define the rule administratively, as a root, system-wide, perhaps
   with some detection of currently interactively logged users

2. make a script that will be continually parsing output of
   "udevadm monitor" and respond appropriatelly to specific events

#1 may not always be available and seems overkill for fulfilling
needs of just a single user.

#2 seems a duplication of what udev already offers natively.

Is there any other solution I am currently missing?

If not, would it be possible to consider a way to expose udev rules
configuration on per-user basis?
Comment 1 Zbigniew Jędrzejewski-Szmek 2015-07-29 14:00:45 EDT
I don't think we can support anything like this. Apart from the problem that privileges are required to create the rule (what you describe), there's the problem that the program started by udev and running under root would have to somehow communicate back to the user services.

Comment 2 Jan Pokorný 2015-07-29 16:27:42 EDT
I hope you at least agree on how paradox this is: user has all the
inputs needed (via "udevadm monitor" or likely directly via libudev
when more suitable), but is left to implement (or reuse the wheel
reinvented by someone else) the rule engine on her own as the
system-wide is not willing to support common users.
Comment 3 Jan Pokorný 2015-07-30 11:15:57 EDT
Created attachment 1057716 [details]
Sample implementation of solution #2.

To be invoked, e.g., from ~/.xinitrc.

Note You need to log in before you can comment on or make changes to this bug.