Basically, without giving the user any new permissions, I am looking to be able to write to
/sys/bus/usb/drivers/usb/unbind
and
/sys/bus/usb/drivers/usb/bind
via a systemd service running as the user and with a group.
I want to only add the necessary permissions to the group or the service, not the user.
The issue is that currently sudoers file does not work with systemd services that way.
When running sudo via sudoers file, since sudo-rs I believe, it will require PAM, which is not loaded when running a systemd service.
Thus, using sudo inside the service, even if it has the right group that is required by the custom sudoers line, it will not work and do a couple authentification retries and then move on.
From what I understand, sudo-rs does not currently supports PAMless.
A udev rule could also do.
The goal is to unbind and rebind a device after grabbing the device file's events, that way any pressed keys will unpress in the unbind and prevent stuck keys in the usb stack.
Thx~