Commit b54920a0 authored by Jan Vcelak's avatar Jan Vcelak

dbus: attach to system bus

parent d7ae5355
......@@ -12,7 +12,7 @@ archive: clean
cp AUTHORS COPYING INSTALL README $(VERSIONED_NAME)
cp tuned.py tuned.spec tuned.service tuned.tmpfiles Makefile tuned-adm.py tuned.bash $(VERSIONED_NAME)
cp tuned.py tuned.spec tuned.service tuned.tmpfiles Makefile tuned-adm.py tuned.bash dbus.conf $(VERSIONED_NAME)
cp -a doc experiments man profiles systemtap tuned $(VERSIONED_NAME)
tar cjf $(VERSIONED_NAME).tar.bz2 $(VERSIONED_NAME)
......@@ -68,6 +68,10 @@ install:
mkdir -p $(DESTDIR)/usr/lib/systemd/system
install -m 0644 tuned.service $(DESTDIR)/usr/lib/systemd/system/tuned.service
# dbus configuration
mkdir -p $(DESTDIR)/etc/dbus-1/system.d
install -m 0644 dbus.conf $(DESTDIR)/etc/dbus-d/system.d/com.redhat.tuned.conf
# manual pages *.8
mkdir -p $(DESTDIR)/usr/share/man/man8
for file in man/*.8; do \
......
<?xml version="1.0"?>
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<!--
This file is part of tuned daemon.
-->
<busconfig>
<policy user="root">
<allow own="com.redhat.tuned"/>
<allow send_destination="com.redhat.tuned" />
<allow receive_sender="com.redhat.tuned" />
</policy>
<policy context="default">
<deny send_destination="com.redhat.tuned"/>
<allow send_destination="com.redhat.tuned" send_interface="org.freedesktop.DBus.Introspectable" />
<allow send_destination="com.redhat.tuned" send_interface="com.redhat.tuned.control" send_member="active_profile" />
<allow send_destination="com.redhat.tuned" send_interface="com.redhat.tuned.control" send_member="status" />
<allow receive_sender="com.redhat.com" />
</policy>
</busconfig>
......@@ -104,6 +104,7 @@ fi
%{_prefix}/lib/tuned
%config(noreplace) %{_sysconfdir}/tuned/active_profile
%{_sysconfdir}/tmpfiles.d
%{_sysconfdir}/dbus-1/systemd.d/com.redhat.tuned.conf
%{_unitdir}/tuned.service
%dir %{_localstatedir}/log/tuned
%dir %{_localstatedir}/run/tuned
......
......@@ -103,7 +103,7 @@ class DBusExporter(tuned.exports.interfaces.ExporterInterface):
def _thread_code(self):
dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
bus = dbus.SessionBus()
bus = dbus.SystemBus()
bus_name = dbus.service.BusName(self._bus_name, bus)
bus_object = self._dbus_object_cls(bus, self._object_name, bus_name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment