博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
dbus启动问题
阅读量:4056 次
发布时间:2019-05-25

本文共 1125 字,大约阅读时间需要 3 分钟。

首先需要启动守护进程
dbus-daemon –system  –print-pid –print-address
结果提示 Failed to start message bus: Could not get UID and GID for username “messagebus”
需要有一个messagebus用户,创建该用户即可,useradd messagebus,问题解决。
执行一个dbus测试程序,提示:D-Bus library appears to be incorrectly set up;
failed to read machine uuid: Failed to open
“/usr/var/lib/dbus/machine-id”: No such file or directory
没有machine-id文件,查了一下,需要给它定义一个id,使用dbus-uuidgen >/usr/var/lib/dbus/machine-id
产生这个文件,该问题解决。
再次执行测试程序,又有问题:Couldn’t connect to session bus: Failed to execute dbus-launch to autolaunch D-Bus session,看了帮助
http://dbus.freedesktop.org/doc/dbus-launch.1.html
AUTOMATIC LAUNCHING一节,需要设置DBUS_SESSION_BUS_ADDRESS环境变量的值,先执行dbus-launch,获得了DBUS_SESSION_BUS_ADDRESS值,再export一下,最后执行测试程序,OK了
在dbus帮助中有一篇关于
dbus-launch的文章
,可以在脚本中启动dbus-launch,同时自动设置DBUS_SESSION_BUS_ADDRESS环境变量,脚本文件rundbus如下:
if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
      ## if not found, launch a new one
      eval `dbus-launch --sh-syntax --exit-with-session`
      echo "D-Bus per-session daemon address is: $DBUS_SESSION_BUS_ADDRESS"
fi
执行. rundbus即可。
                        
本文来自ChinaUnix博客:http://blog.chinaunix.net/u3/93670/showart_1905507.html

转载地址:http://dpoci.baihongyu.com/

你可能感兴趣的文章
yuv to rgb 转换失败呀。天呀。谁来帮帮我呀。
查看>>
yuv420 format
查看>>
yuv420 还原为RGB图像
查看>>
LED恒流驱动芯片
查看>>
驱动TFT要SDRAM做为显示缓存
查看>>
使用file查看可执行文件的平台性,x86 or arm ?
查看>>
qt 创建异形窗体
查看>>
简单Linux C线程池
查看>>
内存池
查看>>
gstreamer相关工具集合
查看>>
RS232 四入四出模块控制代码
查看>>
linux 驱动开发 头文件
查看>>
container_of()传入结构体中的成员,返回该结构体的首地址
查看>>
ipconfig,ifconfig,iwconfig
查看>>
opensuse12.2 PL2303 minicom
查看>>
网络视频服务器移植
查看>>
Encoding Schemes
查看>>
移植QT
查看>>
如此调用
查看>>
计算机的发展史
查看>>