Skip to content
Snippets Groups Projects
Commit 14f4337c authored by George Kiagiadakis's avatar George Kiagiadakis
Browse files

systemd: add templated systemd unit files

These allow running multiple instances of wireplumber with
different config files. The config file is denoted on the service
name, ex: wireplumber@bluetooth loads bluetooth.conf
parent 4f79bccb
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@ systemd = dependency('systemd', required: get_option('systemd'))
if systemd.found()
systemd_config = configuration_data()
systemd_config.set('WP_BINARY', join_paths(wireplumber_bin_dir, 'wireplumber'))
systemd_config.set('WP_CONFIG_DIR', wireplumber_config_dir)
# system service
if get_option('systemd-system-service')
......
......@@ -2,3 +2,7 @@ configure_file(input : 'wireplumber.service.in',
output : 'wireplumber.service',
configuration : systemd_config,
install_dir : systemd_system_unit_dir)
configure_file(input : 'wireplumber@.service.in',
output : 'wireplumber@.service',
configuration : systemd_config,
install_dir : systemd_system_unit_dir)
[Unit]
Description=Multimedia Service Session Manager (%i)
After=pipewire.service
BindsTo=pipewire.service
AssertPathExists=@WP_CONFIG_DIR@/%i.conf
[Service]
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
RestrictNamespaces=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service
Type=simple
ExecStart=@WP_BINARY@ -c %i.conf
Restart=on-failure
User=pipewire
Environment=PIPEWIRE_RUNTIME_DIR=%t/pipewire
[Install]
WantedBy=pipewire.service
......@@ -2,3 +2,7 @@ configure_file(input : 'wireplumber.service.in',
output : 'wireplumber.service',
configuration : systemd_config,
install_dir : systemd_user_unit_dir)
configure_file(input : 'wireplumber@.service.in',
output : 'wireplumber@.service',
configuration : systemd_config,
install_dir : systemd_user_unit_dir)
[Unit]
Description=Multimedia Service Session Manager (%i)
After=pipewire.service
BindsTo=pipewire.service
AssertPathExists=@WP_CONFIG_DIR@/%i.conf
[Service]
LockPersonality=yes
MemoryDenyWriteExecute=yes
NoNewPrivileges=yes
RestrictNamespaces=yes
SystemCallArchitectures=native
SystemCallFilter=@system-service
Type=simple
ExecStart=@WP_BINARY@ -c %i.conf
Restart=on-failure
Slice=session.slice
[Install]
WantedBy=pipewire.service
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment