Add mpDris2-remote.service, --abort-on-disconnect flag#165
Add mpDris2-remote.service, --abort-on-disconnect flag#165ferdnyc wants to merge 7 commits intoeonpatapon:masterfrom
Conversation
Use an implicit pattern rule to convert any `.service.in` file into a `.service` file.
|
Augh! I discovered that this won't work, unfortunately. At least, not exactly as-is. The problem is that the D-Bus service file is still installed with The D-Bus service definition would have to be adjusted as well. Bother. |
|
I suppose it might work to install a second D-Bus service as well, with the bus name |
|
The D-Bus service definition only matters for "on-demand activatable" services. If the process is already running (like if someone has done If you want to avoid confusion (where the user enables the "-remote" service via systemd, but then accidentally causes the "main" service to be activated via D-Bus), then one pattern systemd suggests is to install the systemd service as an ...and then reference that, instead of the original name, from the D-Bus config file: But this also has the side effect that the service doesn't become activatable until it's been enabled. Systemd only has one |
I'm actually more worried about the other way around — if someone has caused the D-Bus service to activate on demand, then starting It's the Is it valid to have D-Bus service files without If D-Bus can't start the daemon (or can only start it using its registered |
The fact that every file in Edit: Confirmed, poop. From the spec:
|
|
OK, next question: Do we actually need the d-bus service definition there at all? I notice VLC doesn't install a |
dbus-daemon won't try to Exec anything if it can start the corresponding systemd service. Systemd distributes several definitions that use Exec=/bin/false to enforce that only one instance (i.e. the systemd-managed instance) will ever be started.
Like I said, the d-bus service definition is for on-demand activation. If the process is already running, then dbus-daemon doesn't look at the service definition for any other purpose. On-demand activation is mostly not applicable to MPRIS due to how the discovery works (most MPRIS clients start by grepping all claimed services for "org.mpris.*", which means the MPRIS client won't know about services unless they're already running), so really the mpdris2 dbus service file will never be used. I don't remember why mpdris2 has a service definition at all, but it might've been for some specific purpose like a |
This PR implements the second service definition I described in #161 (comment), for systems which use an
mpddaemon that isn't running on the same system as the mpDris2 client.For those systems, a systemd service file
mpDris2-remote.serviceis added to the installation, as an alternative tompDris2.service. (The two services are set to conflict, so that one or the other must be used, but not both.)A new flag,
--abort-on-disconnect, is added to the mpDris2 daemon, and used in thempDris2-remote.serviceto have mpDris2 exit uncleanly when a connection failure occurs. Without it, the exits will be clean exits (intended formpDris2.service).The
--no-reconnectlogic is also extended to the initial connection attempt, so that initial startups will not retry when--no-reconnectis set (with or without--abort-on-disconnect).Other changes
A separate commit updates the Makefile to generate
.servicefiles from.service.infiles via a pattern rule, to avoid duplicating the same command for each.servicefile.