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"
    fi

in 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程序即可。

dbus启动失败:Couldn't connect to system bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

时间: 2024-11-05 15:25:50

dbus启动失败:Couldn't connect to system bus: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11的相关文章

Apache服务启动失败couldn't start errorlog process, unable to open logs

在某用户环境下,Apache服务启动失败,报错信息如下 couldn't start errorlog process unable to open logs Apache是我们的产品组件,未防止日志过大 我们使用了Apache自带的切割滚存日志的组件rotatelogs.exe 在httpd.conf配置如下: ErrorLog "|bin/rotatelogs.exe logs/%Y%m%d%H%M%S_error.log 30M" 只要屏蔽这个设置,就可以正常启动Apache,谷

总结遇到的elasticsearch启动失败的几种情况及解决

1.使用root用户启动失败 在有一次搭建elasticsearch的时候,使用systemctl启动elasticsearch失败,然后在bin目录下面去使用启动脚本启动,发现报错不能用root用户启动,报"Caused by: java.lang.RuntimeException: can not run elasticsearch as root": [[email protected] bin]# ./elasticsearch [2017-12-20T17:01:47,922

ORA-01078和LRM-00109问题导致ORACLE启动失败解决方法

操作环境 SuSE11 + ORACLE11gR2(11.2.0.3) 问题现象 新安装ORACLE启动失败,提示ORA-01078和LRM-00109错误.具体错误现象如下 SQL> startup ORA-01078: failure in processing system parameters LRM-00109: could not open parameter file '/home/oracle/base/dbs/initora11g.ora'  问题分析 根据错误分析是查找不到参

Exchange 邮件服务器传输服务启动失败

Exchange 邮件服务器传输服务启动失败 事件属性-事件ID 16023 日志名称:          Application 来源:            MSExchangeTransport 日期:            2014/10/1 14:51:50 事件 ID:         16023 任务类别:          配置 级别:            错误 关键字:           经典 用户:            暂缺 计算机:           TCS-MAI

在windows 2008 R2中SQl Server 2008中代理启动失败的一个原因总结

启动SQL代理的时候报错如下: 关调用实时(JIT)调试而不是此对话框的详细信息,请参见此消息的结尾. ************** 异常文本 **************System.NullReferenceException: 未将对象引用设置到对象的实例. Server stack trace: 在 Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ObjectExplorer.FindObjectExplore

Android ADB Server启动失败

Android ADB Server启动失败 启动Android Stdio的时候报如下错误: 1 2 3 4 5 Unable to create Debug Bridge: Unable to start adb server: error: could not install *smartsocket* listener: cannot bind to 127.0.0.1:5037: 閫氬父姣忎釜濂楁帴瀛楀湴鍧?(鍗忚/缃戠粶鍦板潃/绔彛)鍙厑璁镐娇鐢ㄤ竴娆°?? (10048) c

windows service 1053错误 启动失败

做项目移植的时候发现一个项目的window service启动失败,最后试出来是启动时间超时 解决办法是给window service设置一个长一点的等待时间,步骤如下: 启动,输入regedit启动注册表编辑器 找到HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control 选中control节点,在右边的框中右键,选择新建DWORD值 命名新建的DWORD为: ServicesPipeTimeout 在ServicesPipeTimeout节点右键

MySQL Study之--Mysql启动失败“mysql.host”

MySQL Study之--Mysql启动失败"mysql.host" 系统环境: 操作系统:RedHat EL55 DB Soft:  Mysql 5.6.4-m7 通过源码包安装mysql后,在启动mysqld时出现错误: [[email protected] mysql]# bin/mysqld_safe &[1] 15846[[email protected] mysql]# 150610 17:04:36 mysqld_safe Logging to '/usr/lo

CentOS 7下MySQL服务启动失败的解决思路

今天,启动MySQL服务器失败,如下所示: [[email protected] ~]# /etc/init.d/mysqld start Starting mysqld (via systemctl): Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -