How udev Rules Grant User Access to HID Devices in OpenLogi on Linux
OpenLogi installs a single udev rules file at /etc/udev/rules.d/70-openlogi.rules that uses the TAG+="uaccess" directive to grant the active seat user read/write permissions for Logitech hidraw receivers, uinput virtual devices, and evdev mouse event nodes without requiring root privileges.
OpenLogi interacts directly with hardware interfaces to communicate with Logitech devices and inject input events on Linux. To avoid running the entire application as root, the repository provides udev rules that leverage systemd‑logind access control lists (ACLs) to automatically assign device permissions to the currently logged‑in user.
udev Rules Architecture in OpenLogi
The configuration resides in packaging/linux/udev/70-openlogi.rules and targets three distinct kernel interfaces required by the application.
Logitech HID++ Receivers (hidraw)
The rules match Logitech vendor devices (046d) on the hidraw subsystem, which exposes raw HID reports from Unifying and Lightspeed receivers:
# Logitech HID++ receivers (hidraw)
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="046d", TAG+="uaccess"
SUBSYSTEM=="hidraw", KERNELS=="*:046D:*", TAG+="uaccess"
The TAG+="uaccess" instructs systemd‑logind to add an ACL entry granting the active console user read and write access to /dev/hidraw* nodes as soon as they appear.
uinput Virtual Device
OpenLogi’s input hook creates a virtual input device via the uinput kernel module. The rules ensure the static node exists at boot and is accessible to the user:
KERNEL=="uinput", TAG+="uaccess", OPTIONS+="static_node=uinput"
The OPTIONS+="static_node=uinput" guarantees that /dev/uinput is created by systemd‑tmpfiles even before any application opens the device, preventing race conditions during agent startup.
Logitech Pointer Event Nodes (evdev)
To read events from Logitech mice, the rules target evdev event nodes with mouse classification:
# Logitech mouse event nodes (evdev)
SUBSYSTEM=="input", KERNEL=="event*", ENV{ID_INPUT_MOUSE}=="1",
ATTRS{idVendor}=="046d", TAG+="uaccess"
SUBSYSTEM=="input", KERNEL=="event*", ENV{ID_INPUT_MOUSE}=="1",
KERNELS=="*:046D:*", TAG+="uaccess"
These rules apply the uaccess tag only to event devices (/dev/input/event*) that expose ID_INPUT_MOUSE properties and originate from Logitech hardware, allowing OpenLogi to capture pointer data without broad group permissions.
Installing the udev Rules on Linux
According to the packaging/linux/install.sh script, deploy the rules by copying the file to the system directory and reloading the udev daemon:
# Copy the rules file to the system directory
sudo install -Dm644 packaging/linux/udev/70-openlogi.rules /etc/udev/rules.d/70-openlogi.rules
# Reload udev configuration
sudo udevadm control --reload-rules
# Trigger re-evaluation for already-connected devices
sudo udevadm trigger --subsystem-match=hidraw
sudo udevadm trigger --subsystem-match=input
sudo udevadm trigger --subsystem-match=misc --attr-match=name=uinput
After executing these commands, the current console user can immediately access /dev/hidraw*, /dev/input/event*, and /dev/uinput without additional group membership or sudo rights.
Non-Systemd Compatibility
On init systems that do not run systemd‑logind, the uaccess tag has no effect. The comments in 70-openlogi.rules indicate that administrators can replace TAG+="uaccess" with traditional permissions:
MODE="0660", GROUP="input"
This alternative grants read/write access to members of the input group instead of the active seat user.
Summary
- OpenLogi uses
packaging/linux/udev/70-openlogi.rulesto manage device permissions. - The TAG+="uaccess" mechanism works exclusively with systemd‑logind to assign ACLs to the active user.
- Three kernel interfaces are covered: hidraw (Logitech receivers), uinput (virtual input), and evdev (mouse events).
- Installation requires copying the file to
/etc/udev/rules.d/and runningudevadm control --reload-rules. - For non‑systemd systems, replace the tag with
MODE="0660", GROUP="input"to use group‑based permissions.
Frequently Asked Questions
Where does the udev rules file need to be installed?
The file must be placed at /etc/udev/rules.d/70-openlogi.rules. This path is loaded by the udev daemon during startup and whenever udevadm control --reload-rules is executed. The packaging/linux/install.sh script automates this copy operation and sets the correct mode (0644).
Why does OpenLogi require access to uinput?
OpenLogi creates a virtual input device to inject mouse movement and button events when automation features are enabled. The uinput kernel interface requires write access to /dev/uinput; without the udev rule granting uaccess, the application would need to run as root to register the virtual device.
Can I use these rules on Linux distributions without systemd?
Yes, but you must modify the rules. On systems without systemd‑logind, the uaccess tag is ignored. Edit 70-openlogi.rules and replace TAG+="uaccess" with MODE="0660", GROUP="input" (or another appropriate group). Then add your user to that group and log out for the permissions to take effect.
What happens if I plug in the Logitech device before installing the rules?
If the device is already connected when the rules are installed, you must trigger a re‑evaluation manually. Run sudo udevadm trigger --subsystem-match=hidraw and sudo udevadm trigger --subsystem-match=input to force udev to reapply permissions to existing device nodes based on the new rules.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →