Use the system bus.

Added a dbus service file so we can own the
com.steampowered.SteamOSManager1 name.
Also added a systemd service file
Also add a dbus .conf file to allow any process to talk
to manager for now.
This commit is contained in:
Jeremy Whiting 2023-10-09 10:55:52 -06:00
parent dee6376309
commit 741c5b5ce4
4 changed files with 29 additions and 1 deletions

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!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 can own the service -->
<policy user="root">
<allow own="com.steampowered.SteamOSManager1"/>
</policy>
<!-- Anyone can send messages to the service -->
<policy context="default">
<allow send_destination="com.steampowered.SteamOSManager1"/>
</policy>
</busconfig>

View file

@ -0,0 +1,5 @@
[D-BUS Service]
Name=com.steampowered.SteamOSManager1
Exec=/usr/lib/steamos-manager
User=root
SystemdService=steamosmanager.service

View file

@ -0,0 +1,7 @@
[Unit]
Description=SteamOS Manager Daemon
[Service]
Type=dbus
BusName=com.steampowered.SteamOSManager1
ExecStart=/usr/lib/steamos-manager

View file

@ -35,7 +35,7 @@ async fn main() -> Result<()>
let manager = manager::SMManager {};
let _system_connection = ConnectionBuilder::session()?
let _system_connection = ConnectionBuilder::system()?
.name("com.steampowered.SteamOSManager1")?
.serve_at("/com/steampowered/SteamOSManager1", manager)?
.build()