Bug 1248074

Summary: [RFE] user-specific udev rules
Product: [Fedora] Fedora Reporter: Jan Pokorný [poki] <jpokorny>
Component: systemdAssignee: systemd-maint
Status: CLOSED CANTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: johannbg, jsynacek, lnykryn, msekleta, s, systemd-maint, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-29 18:00:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Sample implementation of solution #2. none

Description Jan Pokorný [poki] 2015-07-29 14:31:28 UTC
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 18:00:45 UTC
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.

Sorry!

Comment 2 Jan Pokorný [poki] 2015-07-29 20:27:42 UTC
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ý [poki] 2015-07-30 15:15:57 UTC
Created attachment 1057716 [details]
Sample implementation of solution #2.

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