~geb/dotool#4: 
Ubuntu permissions

Hello and thanks for another promising looking input tool.

I'm running dotool 1.5-0-g7c0a53ef94ac on Ubuntu 22.04.4 and I'm currently struggling with the following:

$ dotool
dotool: failed to create virtual keyboard device: could not open device file

I've done a fairly verbose form of the standard procedure:

cd dotool && ./build.sh && sudo build.sh install

cat /etc/udev/rules.d/80-dotool.rules
# This allows users in group input to use dotool without root permissions.
KERNEL=="uinput", GROUP="input", MODE="0660", OPTIONS+="static_node=uinput"

sudo udevadm control --reload && sudo udevadm trigger

sudo usermod -aG input donjan
sudo reboot

And it doesn't let me, as per above. It works with sudo, but that's hardly practical for automation.

Am I missing something obvious?

I've even stooped to desperate measures such as this, to no avail:

sudo chown :input $(which dotool)
sudo chmod g+s $(which dotool)

(likewise, doing the same to dotoolc and dotoold is futile)

Status
RESOLVED CLOSED
Submitter
~donjan
Assigned to
No-one
Submitted
3 months ago
Updated
3 months ago
Labels
No labels applied.

~geb 3 months ago

I'm not sure why the udev rule isn't working, being in the group (can check id -Gn for certainty) and rebooting should be enough normally.

It's the permissions of /dev/uinput which are the issue, and what the udev rule is supposed to set. Here's what I get running ls -l /dev/uinput:

crw-rw---- 1 john input 10, 223 Aug 10 11:08 /dev/uinput

You could chown/chmod /dev/uinput as a sad workaround, it would need to be done every reboot.

The udev rule could technically be being overridden by another udev rule, but that's never came up before. A systemd release last year broke its support for uinput udev rules, but the next release resolved it: https://bugs.archlinux.org/task/79391

~donjan 3 months ago

That's the ticket. I was playing with other tools (ydotool etc.), and they apparently have conflicting udev rules. Almost the same, just with the additional step of manually creating a uinput group, so I'm not sure why it conflicts. But cleaning up and removing those makes dotool work.

Just for reference, my /dev/uinput is owned by root:

crw-rw---- 1 root input 10, 223 Aug 12 21:57 /dev/uinput

In any case, thank you for pointing me in the right direction!

~geb REPORTED CLOSED 3 months ago

Great! Thanks for reporting back with the solution!

kiasoc5 3 months ago ยท edit

Writing to say that on my Debian bookworm machine, upgrading systemd to version 254 from backports fixes the udev rule, as suggested by the Arch ticket.

Register here or Log in to comment, or comment via email.