关于dbus的三个概念的理解

来源:互联网 发布:软件编写教程 编辑:程序博客网 时间:2024/05/18 00:33
首先,dbus是利用了dbus这种机制来实现与进程的交互。
在交互当中,连接时,需要提供busname、object-path、interface.
如何理解,上面这三个东西,是理解dbus应用的关键:
busname是程序的名字,是在service文件当中指定的。
如下面所示:
[root@proEnv23 ~]# cat /usr/lib/systemd/system/systemd-timedated.service
#  This file is part of systemd.
#
#  systemd is free software; you can redistribute it and/or modify it
#  under the terms of the GNU Lesser General Public License as published by
#  the Free Software Foundation; either version 2.1 of the License, or
#  (at your option) any later version.

[Unit]
Description=Time & Date Service
Documentation=man:systemd-timedated.service(8) man:localtime(5)
Documentation=http://www.freedesktop.org/wiki/Software/systemd/timedated

[Service]
ExecStart=/usr/lib/systemd/systemd-timedated
BusName=org.freedesktop.timedate1
CapabilityBoundingSet=CAP_SYS_TIME
WatchdogSec=1min
PrivateTmp=yes
ProtectSystem=yes
ProtectHome=yes
[root@proEnv23 ~]# gdbus introspect --system --dest org.freedesktop.timedate1
Error: Object path is not specified
[root@proEnv23 ~]# 


object-path是对象的路径,其实现了下面的interface的接口
interface是接口。

0 0
原创粉丝点击