dbus_bus_request_name():不允许连接拥有该服务

发布于 2024-10-09 20:22:14 字数 638 浏览 0 评论 0原文

我在arm上构建了一个根文件系统。它应该运行 dbus-daemon 和 avahi-daemon,但是当我尝试运行 avahi-daemon 时,

$ dbus-daemon --system
$ avahi-daemon

我收到以下消息:

Found user 'avahi' (UID 4) and group 'avahi' (GID 4).
Successfully dropped root privileges.
avahi-daemon 0.6.28 starting up.
WARNING: No NSS support for mDNS detected, consider installing nss-mdns! 
dbus_bus_request_name(): Connection ":1.0" is not allowed to own the service "org.freedesktop.Avahi" due to security policies in the configuration file
WARNING: Failed to contact D-Bus daemon.
avahi-daemon 0.6.28 exiting.

出了什么问题?与 dbus 配置有关吗?

I built a root filesystem on arm. It should run dbus-daemon and avahi-daemon, but when I try to run avahi-daemon

$ dbus-daemon --system
$ avahi-daemon

I get this message:

Found user 'avahi' (UID 4) and group 'avahi' (GID 4).
Successfully dropped root privileges.
avahi-daemon 0.6.28 starting up.
WARNING: No NSS support for mDNS detected, consider installing nss-mdns! 
dbus_bus_request_name(): Connection ":1.0" is not allowed to own the service "org.freedesktop.Avahi" due to security policies in the configuration file
WARNING: Failed to contact D-Bus daemon.
avahi-daemon 0.6.28 exiting.

What is wrong? Is it about dbus configuration ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

余生再见 2024-10-16 20:22:14

就我而言,我只需重新启动 dbus 服务即可。

这可能是因为 avahi 插入了一个未自动检测到的 dbus 配置文件 (/etc/dbus-1/system.d/avahi-dbus.conf)。

In my case I simply had to restart the dbus service.

This probably was because avahi inserted a dbus config file (/etc/dbus-1/system.d/avahi-dbus.conf) which wasn't detected automatically.

み青杉依旧 2024-10-16 20:22:14

哪些客户端可以在系统总线上注册哪些名称是有限制的。否则,用户进程可能会收到针对某些系统服务的请求。
这些限制是通过 dbus-daemon 配置文件配置的,通常是 /etc/dbus-1/system.conf。在标准安装中,此文件包含其他配置文件,尤其是存储特定于服务的配置的 /etc/dbus-1/system.d/ 目录中的所有配置文件。通常通过这种方式为 Avahi 配置 DBus:

我的工作站中的示例:

$ cat /etc/dbus-1/system.d/avahi-dbus.conf 
<!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 or user avahi can own the Avahi service -->
  <policy user="avahi">
    <allow own="org.freedesktop.Avahi"/>
  </policy>
  <policy user="root">
    <allow own="org.freedesktop.Avahi"/>
  </policy>

  <!-- Allow anyone to invoke methods on Avahi server, except SetHostName -->
  <policy context="default">
    <allow send_destination="org.freedesktop.Avahi"/>
    <allow receive_sender="org.freedesktop.Avahi"/>

    <deny send_destination="org.freedesktop.Avahi"
          send_interface="org.freedesktop.Avahi.Server" send_member="SetHostName"/>
  </policy>

  <!-- Allow everything, including access to SetHostName to users of the group "adm" -->
  <policy group="adm">
    <allow send_destination="org.freedesktop.Avahi"/>
    <allow receive_sender="org.freedesktop.Avahi"/>
  </policy>
  <policy user="root">
    <allow send_destination="org.freedesktop.Avahi"/>
    <allow receive_sender="org.freedesktop.Avahi"/>
  </policy>
</busconfig>

确保您拥有这些标准配置文件或适当的自定义配置。

There are restrictions on what client can register what name on the system bus. Otherwise a user process could receive request intended for some system service.
The restrictions are configured via the dbus-daemon configuration file, usually /etc/dbus-1/system.conf. In standard installations this file includes other config files, especially all in the /etc/dbus-1/system.d/ directory, where service specific configurations are stored. This way DBus is usually configured for Avahi:

Example from my workstation:

$ cat /etc/dbus-1/system.d/avahi-dbus.conf 
<!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 or user avahi can own the Avahi service -->
  <policy user="avahi">
    <allow own="org.freedesktop.Avahi"/>
  </policy>
  <policy user="root">
    <allow own="org.freedesktop.Avahi"/>
  </policy>

  <!-- Allow anyone to invoke methods on Avahi server, except SetHostName -->
  <policy context="default">
    <allow send_destination="org.freedesktop.Avahi"/>
    <allow receive_sender="org.freedesktop.Avahi"/>

    <deny send_destination="org.freedesktop.Avahi"
          send_interface="org.freedesktop.Avahi.Server" send_member="SetHostName"/>
  </policy>

  <!-- Allow everything, including access to SetHostName to users of the group "adm" -->
  <policy group="adm">
    <allow send_destination="org.freedesktop.Avahi"/>
    <allow receive_sender="org.freedesktop.Avahi"/>
  </policy>
  <policy user="root">
    <allow send_destination="org.freedesktop.Avahi"/>
    <allow receive_sender="org.freedesktop.Avahi"/>
  </policy>
</busconfig>

Make sure you have these standard configuration files or a proper custom configuration in place.

勿忘初心 2024-10-16 20:22:14

我有一个类似的问题,在我的情况下,我的系统数据包系统附带的默认avahi-dbus.conf只是缺少“ ” ; ”触发了此错误。

我首先认为问题不是来自这个文件,因为快速查看它不足以找到这种语法错误。

I had a similar problem, in my case the default avahi-dbus.conf that come with my system packet system just lack the last " </policy> " before " </busconfig> " which triggered this error.

I first thought the problem didn't come from this file since a rapid look at it is not enough to find this kind of syntax error.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文