Skip to content

media-session: add systemd unit files & option to enable/disable building it

George Kiagiadakis requested to merge gkiagia/pipewire:systemd into master

This adds systemd unit files for media-session, which gives better control of this process from the systemd point of view.

The new unit specifies BindsTo=pipewire.service which means that it will be stopped / restarted if pipewire.service is stopped / restarted respectively and also it binds to the activation of pipewire.service (i.e. in case pipewire.service fails, media-session will not start... or if pipewire crashes, media-session will stop, etc)

My intention is to provide a similar unit for wireplumber as well. Switching between the two should be a matter of disabling one unit and enabling the other instead. Being a systemd unit instead of a line in a config file also gives better control to distributions to change session manager by removing one package and installing another, without requiring the user to edit the config file at that point.

This change also introduces a regression for non-systemd users. They will now need to edit the config file to enable media-session right after installation. I don't think this is too invasive, as distributions that ship pipewire without systemd can also edit the config file at packaging time.

Merge request reports