Bug 1248074 - [RFE] user-specific udev rules
Summary: [RFE] user-specific udev rules
Keywords:
Status: CLOSED CANTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 22
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-07-29 14:31 UTC by Jan Pokorný [poki]
Modified: 2015-07-30 15:15 UTC (History)
7 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2015-07-29 18:00:45 UTC
Type: Bug
Embargoed:


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

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.


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