[SOLVED] Can't start blueman-applet as a regular user in Slackware64-14.2 - permissions issue?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can't start blueman-applet as a regular user in Slackware64-14.2 - permissions issue?
Hi,
First of all, I'm new to Bluetooth in general, so please be patient. I want to use my Bluetooth headset with my PC. I have a USB BT dongle, which seems to be working:
Code:
# lsusb | grep -i bluetooth
Bus 001 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
# hciconfig
hci0: Type: Primary Bus: USB
BD Address: 01:23:45:67:89:ab ACL MTU: 310:10 SCO MTU: 64:8
UP RUNNING
RX bytes:1457 acl:0 sco:0 events:116 errors:0
TX bytes:1376 acl:0 sco:0 commands:107 errors:0
# bluetoothctl
[NEW] Controller 01:23:45:67:89:ab BlueZ 5.47 [default]
Agent registered
[bluetooth]# scan on
Discovery started
[CHG] Controller 01:23:45:67:89:ab Discovering: yes
[NEW] Device ... [my headphones are detected]
So far so good. I also noticed that an application blueman-applet is added to autostart in XFCE, but it fails to start (as a regular user, I'm not using DE as root). This is the error message in the console:
Code:
$ blueman-applet
blueman-applet version 2.0.6 starting
_________
Load (/usr/lib64/python2.7/site-packages/blueman/main/PluginManager.py:60)
['RecentConns', 'DhcpClient', 'AuthAgent', 'NMPANSupport', 'Headset', 'DBusService', 'ShowConnected', 'KillSwitch', 'Menu', 'NetUsage', 'StandardItems', 'GameControllerWakelock', 'PPPSupport', 'SerialManager', 'NMDUNSupport', 'Networking', 'StatusIcon', 'ExitItem', 'DiscvManager', 'TransferService', 'PowerManager']
ERROR:dbus.proxies:Introspect error on :1.0:/: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.183" (uid=1000 pid=9382 comm="/usr/bin/python2.7 /usr/bin/blueman-applet ") interface="org.freedesktop.DBus.Introspectable" member="Introspect" error name="(unset)" requested_reply="0" destination=":1.0" (uid=0 pid=1227 comm="/usr/sbin/bluetoothd ")
Traceback (most recent call last):
File "/usr/bin/blueman-applet", line 121, in <module>
BluemanApplet()
File "/usr/bin/blueman-applet", line 63, in __init__
self.Plugins.Load()
File "/usr/lib64/python2.7/site-packages/blueman/main/PluginManager.py", line 90, in Load
__import__(self.module_path.__name__ + ".%s" % plugin, None, None, [])
File "/usr/lib64/python2.7/site-packages/blueman/plugins/applet/AuthAgent.py", line 9, in <module>
import blueman.main.applet.BluezAgent as BluezAgent
File "/usr/lib64/python2.7/site-packages/blueman/main/applet/BluezAgent.py", line 23, in <module>
from blueman.bluez.Agent import Agent, AgentMethod
File "/usr/lib64/python2.7/site-packages/blueman/bluez/Agent.py", line 48, in <module>
class Agent(dbus.service.Object):
File "/usr/lib64/python2.7/site-packages/blueman/bluez/Agent.py", line 56, in Agent
@AgentMethod
File "/usr/lib64/python2.7/site-packages/blueman/bluez/Agent.py", line 38, in AgentMethod
if BlueZInterface.get_interface_version()[0] < 5:
File "/usr/lib64/python2.7/site-packages/blueman/bluez/BlueZInterface.py", line 17, in get_interface_version
introspection = dbus.Interface(obj, 'org.freedesktop.DBus.Introspectable').Introspect()
File "/usr/lib64/python2.7/site-packages/dbus/proxies.py", line 70, in __call__
return self._proxy_method(*args, **keywords)
File "/usr/lib64/python2.7/site-packages/dbus/proxies.py", line 145, in __call__
**keywords)
File "/usr/lib64/python2.7/site-packages/dbus/connection.py", line 651, in call_blocking
message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 2 matched rules; type="method_call", sender=":1.183" (uid=1000 pid=9382 comm="/usr/bin/python2.7 /usr/bin/blueman-applet ") interface="org.freedesktop.DBus.Introspectable" member="Introspect" error name="(unset)" requested_reply="0" destination=":1.0" (uid=0 pid=1227 comm="/usr/sbin/bluetoothd ")
I understand that the application is trying to communicate with Bluetooth daemon over DBus, but the attempt is denied. And I see a similar error in the syslog when I'm trying to use bluetoothctl as a regular user:
It is possible to start blueman-applet as root user, so I think this is just a permission error. As far as I was able to investigate, default DBus configuration disallows sending messages for method calls, but files in /etc/dbus-1/ can specify exceptions to that rule. The file /etc/dbus-1/system.d/bluetooth.conf installed by blues says:
Code:
<busconfig>
<!-- ../system.conf have denied everything, so we just punch some holes -->
<policy user="root">
<allow own="org.bluez"/>
<allow send_destination="org.bluez"/>
<allow send_interface="org.bluez.Agent1"/>
<allow send_interface="org.bluez.MediaEndpoint1"/>
<allow send_interface="org.bluez.MediaPlayer1"/>
<allow send_interface="org.bluez.ThermometerWatcher1"/>
<allow send_interface="org.bluez.AlertAgent1"/>
<allow send_interface="org.bluez.Profile1"/>
<allow send_interface="org.bluez.HeartRateWatcher1"/>
<allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
<allow send_interface="org.bluez.GattCharacteristic1"/>
<allow send_interface="org.bluez.GattDescriptor1"/>
<allow send_interface="org.freedesktop.DBus.ObjectManager"/>
<allow send_interface="org.freedesktop.DBus.Properties"/>
</policy>
<policy at_console="true">
<allow send_destination="org.bluez"/>
</policy>
<!-- allow users of lp group (printing subsystem) to
communicate with bluetoothd -->
<policy group="lp">
<allow send_destination="org.bluez"/>
</policy>
<policy context="default">
<deny send_destination="org.bluez"/>
</policy>
</busconfig>
My user is in "lp" group, so I don't understand why am I not allowed to send these DBus messages?
Code:
$ id
uid=1000(arcctgx) gid=100(users) groups=100(users),7(lp),17(audio),18(video),19(cdrom),83(plugdev),84(power),86(netdev)
Unfortunately I don't know enough about DBus to debug this issue further. I would appreciate some help with this.
Maybe I am not supposed to run blueman-applet as a regular user at all? But if that was the case, why would it try to autostart with XFCE as regular user? And I would really prefer to use a GUI for handling Bluetooth devices, instead of doing everything in console as root.
You'll have to restart after adding your user to the lp group for DBus to pick up the change. (You can try restarting DBus, but not from an X session.)
If you've rebooted at least once after adding your user to the lp group, then it's a different issue.
You'll have to restart after adding your user to the lp group for DBus to pick up the change. (You can try restarting DBus, but not from an X session.)
OK, I feel silly now. Rebooting the PC is all it took to make it work. In my defense, I rarely reboot these days, I mostly use hibernation. Before I rebooted the machine I only shut down the X session, logged out and in again so that my regular user would be in "lp" group. I wasn't aware that restarting DBus is necessary as well.
One more observation. Before I added my user to "lp" group using gpasswd (which permanently modified /etc/group), my regular user account was being added to "lp" group at login by means of CONSOLE_GROUPS defined in /etc/login.defs. But that wasn't enough to allow sending DBus messages to bluez. If I understand correctly, restarting DBus after logging in as my regular user would grant me the required permissions?
Anyway, it's looking good now, blueman-applet started and I was able to pair my headphones as a regular user. I guess the output of these commands it what is expected?
OK, I feel silly now. Rebooting the PC is all it took to make it work. In my defense, I rarely reboot these days, I mostly use hibernation. Before I rebooted the machine I only shut down the X session, logged out and in again so that my regular user would be in "lp" group. I wasn't aware that restarting DBus is necessary as well.
Oh, you aren't the only one who thinks that way. DBus appears to cache that information somewhere on startup and doesn't bother to update the cache when the group list changes. I was pretty annoyed myself when this happened to me. ¯\_(ツ)_/¯
Quote:
Originally Posted by arcctgx
One more observation. Before I added my user to "lp" group using gpasswd (which permanently modified /etc/group), my regular user account was being added to "lp" group at login by means of CONSOLE_GROUPS defined in /etc/login.defs. But that wasn't enough to allow sending DBus messages to bluez. If I understand correctly, restarting DBus after logging in as my regular user would grant me the required permissions?
The only problem is that everything in your desktop environment is pointing to the old DBus socket; you'd be amazed at what stops working at that point.
I wrote something about this a while back in this forum, but I can't find the thread.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.