国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學(xué)院 > 操作系統(tǒng) > 正文

org.freedesktop.DBus.Error.AccessDenied解決辦法

2024-06-28 16:01:03
字體:
供稿:網(wǎng)友

運(yùn)行自己用python寫的dbus服務(wù)時(shí),出現(xiàn)如下錯(cuò)誤:

Traceback (most recent call last):  File "./test.py", line 87, in <module>    object = DeviceObject()  File "./test.py", line 37, in __init__    bus_name = dbus.service.BusName(Bus_Name,bus=dbus.SystemBus())  File "/usr/lib/python2.7/dist-packages/dbus/service.py", line 131, in __new__    retval = bus.request_name(name, name_flags)  File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 303, in request_name    'su', (name, flags))  File "/usr/lib/python2.7/dist-packages/dbus/connection.py", line 651, in call_blocking    message, timeout)dbus.exceptions.DBusException: org.freedesktop.DBus.Error.accessDenied: Connection ":1.92" is not allowed to own the service "com.foxbryant.demo" due to security policies in the configuration file

解決方法:

在/etc/dbus-1/system.d/目錄下創(chuàng)建com.foxbryant.demo.conf (名稱隨意,以.conf結(jié)尾即可) 內(nèi)容如下:

<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"><busconfig>  <!-- Only root and devel can own the service -->  <policy user="root">    <allow own="com.foxbryant.demo"/>    <allow send_destination="com.foxbryant.demo"/>    <allow send_interface="com.foxbryant.demo"/>  </policy>  <policy user="foxbryant">    <allow own="com.foxbryant.demo"/>    <allow send_destination="com.foxbryant.demo"/>    <allow send_interface="com.foxbryant.demo"/>  </policy></busconfig>


發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 咸阳市| 依兰县| 洞头县| 山西省| 抚松县| 海城市| 揭东县| 平定县| 岑溪市| 神农架林区| 龙山县| 三河市| 封开县| 巴南区| 新兴县| 泉州市| 平邑县| 广宗县| 龙岩市| 平果县| 山西省| 德惠市| 洞头县| 铅山县| 敦煌市| 海宁市| 明溪县| 通辽市| 宜城市| 宜昌市| 沁阳市| 海城市| 江孜县| 工布江达县| 太仆寺旗| 西丰县| 太白县| 乐东| 喀喇沁旗| 嘉定区| 和顺县|