Piper+Ratbagd "Cannot connect to ratbagd"

Hello everyone,

I am trying to set up Piper + Ratbagd, and just cannot seem to get Piper to talk to Ratbagd. When I launch piper, I see “Cannot connect to ratbagd”.

systemctl status ratbagd shows “Active: active (running)”, and groups kn100 shows kn100 : kn100 games. My /etc/group definition for games is

kn100:!:1000:kn100
games:x:457:kn100

I’ve run out of ideas to get this to work! Does anybody have any suggestions for what could be wrong here?

@kn100 as you user does ratbagctl list show your device, for example;

ratbagctl list
hollering-marmot:    Logitech G203 LIGHTSYNC Gaming Mouse
1 Like
ratbagctl list
Unable to connect to ratbagd: Make sure it is running and your user is in the required groups.
# however, as root
sudo ratbagctl list
bellowing-paca:      Logitech G502 

Hmnn… So that does seem to imply some sort of permissions problem!

If you’ve got any suggestions around that, they’d be much appreciated, although I am curious as which user ratbagd is running on your system? On mine, ratbagd seems to be running as root.

ratbagctl list
Unable to connect to ratbagd: Make sure it is running and your user is in the required groups.
# however, as root
sudo ratbagctl list
bellowing-paca:      Logitech G502 

Hmnn… So that does seem to imply some sort of permissions problem!

If you’ve got any suggestions around that, they’d be much appreciated, although I am curious as which user ratbagd is running on your system? On mine, ratbagd seems to be running as root.

I’ll also added I tried disabling Opensuses hardening for ratbagd, like so:

cat /etc/systemd/system/ratbagd.service
 kn100@localhost  ~  cat /etc/systemd/system/ratbagd.service 
[Unit]
Description=Daemon to introspect and modify configurable mice

[Service]
# added automatically, for details please see
# https://en.opensuse.org/openSUSE:Security_Features#Systemd_hardening_effort
#ProtectSystem=full
#ProtectHome=true
#ProtectHostname=true
#ProtectKernelTunables=true
#ProtectKernelModules=true
#ProtectKernelLogs=true
#ProtectControlGroups=true
#RestrictRealtime=true
# end of automatic additions 
Type=dbus
BusName=org.freedesktop.ratbag1
ExecStart=/usr/sbin/ratbagd
Restart=on-abort

[Install]
Alias=dbus-org.freedesktop.ratbag1.service

@kn100 As you user, what is the output from the command groups

 kn100@localhost  ~  groups
kn100
 kn100@localhost  ~  groups kn100
kn100 : kn100 games
 kn100@localhost  ~  

This doesn’t make a massive amount of sense to me, have I perhaps screwed something up while adding myself to the games group?

What does your /etc/group look like for both the line that starts with your username and the line that starts games I wonder?

@kn100 Have you logged out and back in after adding yourself to the games group?

Yes, I’ve also restarted the entire system

@kn100 If you fire up YaST Users and Groups and check in there, maybe unselect, save/exit and then go back in and add again.

So, I went to YaST Users and Groups, removed games from my user, rebooted, then readded games, and logged out/in, the symptoms I describe above are still present:

kn100@localhost  ~  groups
kn100
 kn100@localhost  ~  groups kn100
kn100 : kn100 games
 kn100@localhost  ~  sudo systemctl status ratbagd
● ratbagd.service - Daemon to introspect and modify configurable mice
     Loaded: loaded (/etc/systemd/system/ratbagd.service; disabled; preset: disabled)
     Active: active (running) since Sun 2024-05-26 13:36:25 EDT; 1min 47s ago
   Main PID: 7906 (ratbagd)
      Tasks: 1 (limit: 4915)
        CPU: 33ms
     CGroup: /system.slice/ratbagd.service
             └─7906 /usr/sbin/ratbagd

May 26 13:36:25 localhost.localdomain systemd[1]: Starting Daemon to introspect and modify configurable mice...
May 26 13:36:25 localhost.localdomain systemd[1]: Started Daemon to introspect and modify configurable mice.
 kn100@localhost  ~  sudo ratbagctl list
singing-hare:        Logitech G502                   

 kn100@localhost  ~  ratbagctl list
Unable to connect to ratbagd: Make sure it is running and your user is in the required groups.

Is there any chance you could share your /etc/group file with me, specifically the entries relating to your user and games? I wouldn’t discount the possibility of me screwing something up with a usermod command.

@kn100 As follows;

groups

username users libvirt plugdev boinc rtlsdr games video render i2c

groups username

username : username users render video games libvirt rtlsdr boinc i2c plugdev

cat /etc/group | grep username

users:x:100:username
render:x:484:username
video:x:481:gdm,username
username:!:1000:
games:x:453:username
libvirt:x:108:libvirtdbus,username
rtlsdr:x:449:username,pfclient
boinc:x:442:username
i2c:x:1001:username
plugdev:x:432:username

I would suggest creating a test user, add that test user to games via YaST and then logout, login as the test user and check if ratbagctl works…

Nailed it!

I created a new user, and added the user to the games group and piper immediately started working for that user. I then compared the groups for both users, and noticed that somehow my main user was not in the users group. I added myself to users using usermod -a -G users kn100 and voila, piper started working as expected! Thanks for your help.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.