dbus启动失败:Couldn't connect to system bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
在没有开启x窗口的shell下启动dbus相关程序时会如上错误,详细原因如下:
This is not considered to be a bug. Auto-launching D-Bus sessions when
not under X11 would result in one new D-Bus session per application that
tried to use it, unable to communicate with other user-facing
applications that do not share that session; those sessions would also
never exit, leaving unused dbus-daemon and dbus-launch processes
building up indefinitely (until the next reboot). That's clearly not
useful or desirable, but in the absence of a clear and
machine-detectable definition of "session" we can't really improve on
it. (Under X11, the lifetime of the X server acts as the definition of
the session, so autolaunching can work and is useful.)Applications that can usefully be run either with or without a D-Bus
session, such as pulseaudio, should treat errors in connecting to the
session bus as non-fatal, and continue to have the rest of their
functionality. I believe PA already does this, in fact; that message in
your syslog just tells you that the D-Bus part of its functionality will
not be active.If you do need to start a D-Bus session while not under X11, you can run
dbus-launch as documented in the dbus-launch(1) man page, something like
this:if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
eval `dbus-launch --sh-syntax`
echo "D-Bus per-session daemon address is:"
echo "$DBUS_SESSION_BUS_ADDRESS"
fiin which case you're responsible for getting the
DBUS_SESSION_BUS_ADDRESS environment variable to all the processes that
should share the session, and managing the lifetime of the session (i.e.
killing the session's dbus-daemon when appropriate). I have sent patches
upstream to add a dbus-run-session tool that runs a session for as long
as its child process is running and then terminates it (similar
semantics to schroot), but they haven't been merged yet.Older versions of dbus-launch tried to monitor the lifetime of text
login sessions on virtual consoles, but the way they did that would
consume every second character of input (Debian bug #453755) and it
isn't clear whether it actually ended the session on logout either. This
was fixed by several changes between squeeze and wheezy.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=690530
解决办法:
先执行命令
eval `dbus-launch --sh-syntax`
在运行dbus程序即可。
最新文章
- sqlplus无密码登录TNS协议适配器错误
- 云主机-vps购买
- oc总结
- 四个常用.NET的SqlHelper的方法
- iOS开发——设备信息小结(未完待续...)
- CMOS门电路
- 链表中倒数第k个节点(Java)
- (转)springcloud(一):大话Spring Cloud
- Nginx 开启目录下载
- ABP+AdminLTE+Bootstrap Table权限管理系统第十一节--Bootstrap Table用户管理列表以及Module Zero之用户管理
- Zabbix报警执行远程命令
- SpringData Redis
- ajax 简介0
- X Window(远程桌面)
- Android 常用动画之RotateAnimation
- Golang Vendor 包管理工具 glide 使用教程
- 如何更改webstrom的默认端口63342
- 独立开发人员低成本推广APP的18条技巧
- sqlserver查询最接近的记录
- 原创Java多线程详解(一)