以root用户身份连接到D-Bus失败

时间:2018-07-06 11:58:27

标签: linux ubuntu session dbus

我正在使用Ubuntu 16.04。我的应用程序必须连接到会话D-Bus和系统D-Bus。如果我以登录用户身份运行应用程序,则该应用程序同时连接到会话D-Bus和系统D-Bus。但是,如果我以root用户身份运行,则会收到以下错误:

process 11030: arguments to dbus_bus_request_name() were incorrect,     assertion "connection != NULL" failed in file dbus-bus.c line 1120.
This is normally a bug in some application using the D-Bus library.
./libdbus-1.so.3(+0x6314d) [0x7f0c6c28914d]
./libdbus-1.so.3(+0x65fb9) [0x7f0c6c28bfb9]
./libdbus-1.so.3(_dbus_warn_check_failed+0x10e) [0x7f0c6c27484e]
./libdbus-1.so.3(dbus_bus_request_name+0x210) [0x7f0c6c23b9a0]
./HelloWorldService(_Z14myRegsitrationv+0xa4) [0x4687da]
./HelloWorldService(main+0x54) [0x468a09]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f0c6b18f830]
./HelloWorldService(_start+0x29) [0x468229]

中止

实际上,我是D-Bus的新手,我怀疑root用户是否拥有会话总线? 有人可以帮我吗?

0 个答案:

没有答案