国产探花免费观看_亚洲丰满少妇自慰呻吟_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ā)表
主站蜘蛛池模板: 西乌珠穆沁旗| 田林县| 彭水| 通州市| 油尖旺区| 平远县| 临沂市| 山阳县| 公主岭市| 阳西县| 兴化市| 越西县| 万州区| 宣城市| 芜湖县| 武胜县| 永福县| 如东县| 麻城市| 朔州市| 桂阳县| 基隆市| 手机| 黄冈市| 沙坪坝区| 黄平县| 宁明县| 博罗县| 许昌市| 渑池县| 苏州市| 仪征市| 万年县| 连江县| 镇原县| 封丘县| 隆回县| 剑河县| 南丹县| 宜城市| 溧水县|