d-bus配置文件

启动

D-Bus服务进程可以按需要启动对应服务。有两种启动方式,它们都需要请求服务的客户提供要连接的公共名:

1. 使用总线对象所提供的方法
2. 使用连接公共名,直接调用目标连接上的对象方法

要建立可以自动启动的服务,需要设置服务配置文件。服务配置以UTF-8文本形式存放在.service文件中。比如com.xl.safe.service(文件名是任意的,但必须以.service结尾,放到目录/usr/share/dbus-1/services下

文件格式如下:

[D-BUS Service]
Name=com.xl.cnossafe;com.xl.secure
Exec=/opt/xl/safed
User=root

设置

目录/etc/dbus-1/system.d下

com.xl.cnossafe.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 user root can own the foo helper -->
  <policy user="root">
    <allow own="com.xl.cnossafe"/>
  </policy>
 
  <!-- Allow anyone to call into the service - we'll reject callers using PolicyKit -->
  <policy context="default">
    <allow send_destination="com.xl.cnossafe"/>
  </policy>
 
</busconfig>
 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值