Connecting to dbus over tcp

后端 未结 3 1037
故里飘歌
故里飘歌 2020-12-07 18:05

I wrote a simple python program to play and pause banshee music player. While its working on my own machine, I have trouble doing it to a remote computer, connected to the s

3条回答
  •  醉梦人生
    2020-12-07 18:31

    since dbus 1.6.12 (e.g. kubuntu 13.10), your connection will also be rejected unless you add to your dbus config file (either /etc/dbus-1/mybus.conf or the interface requiring remote access i.e. system.d/my.interface.conf)

    
    

    UPDATE: After struggling to create a apparmor profile allowing the service to connect to the custom dbus-daemon, it seems the connection is always rejected due to a bug in DBUS... So for now we MUST disable apparmor whenever you use tcp=... Bug fix targetted for 14.04

    I opened a bug at bugs.launchpad.net following discussion here with Tyler Hicks:

    The AppArmor mediation code only has the ability to check peer labels over UNIX domain sockets. It is most likely seeing an error when getting the label and then refusing the connection.

    Note: the disable flag is not recognized by dbus < 1.6.12, so you need to package different versions of mydaemon.conf depending on systen), else dbus-daemon will fail on launch if no apparmor... I used for now in my CMakeLists.txt :

    IF(EXISTS "/usr/sbin/apparmor_status")
      install(FILES dbus_daemon-apparmordisabled.conf RENAME dbus_daemon.conf DESTINATION /etc/dbus-1/ )
    ELSE (EXISTS "/usr/sbin/apparmor_status")
       install(FILES dbus_daemon.conf DESTINATION /etc/dbus-1/ )
    ENDIF(EXISTS "/usr/sbin/apparmor_status")
    

提交回复
热议问题