summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2021-07-14 13:27:40 +0300
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2021-07-28 13:19:02 +0300
commitb6f553a33e751ad51abf036ab0ce7b01ee99e39a (patch)
treecde6ad9709084103d826ba57b4ba2a84f0060275 /src
parent4ad92cc00f6beb6e29c36b7c8316df9b7360903d (diff)
server: add systemd units + socket-activation support
Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
Diffstat (limited to 'src')
-rw-r--r--src/meson.build10
-rw-r--r--src/pipewire-ic-ipc.service22
-rw-r--r--src/pipewire-ic-ipc.socket12
3 files changed, 44 insertions, 0 deletions
diff --git a/src/meson.build b/src/meson.build
index 7ef8754..3e3f916 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -16,4 +16,14 @@ if get_option('server')
install_dir : pipewire_dep.get_variable(pkgconfig: 'moduledir'),
dependencies : [icipc_dep, pipewire_dep],
)
+
+ if systemd_dep.found() and libsystemd_dep.found()
+ systemd_system_services_dir = systemd_dep.get_pkgconfig_variable(
+ 'systemdsystemunitdir',
+ define_variable: ['prefix', get_option('prefix')])
+
+ install_data(
+ sources: ['pipewire-ic-ipc.socket', 'pipewire-ic-ipc.service'],
+ install_dir: systemd_system_services_dir)
+ endif
endif
diff --git a/src/pipewire-ic-ipc.service b/src/pipewire-ic-ipc.service
new file mode 100644
index 0000000..f961f6c
--- /dev/null
+++ b/src/pipewire-ic-ipc.service
@@ -0,0 +1,22 @@
+[Unit]
+Description=PipeWire AGL Instrument Cluster IPC
+After=pipewire.socket
+
+[Service]
+LockPersonality=yes
+MemoryDenyWriteExecute=yes
+NoNewPrivileges=yes
+RestrictNamespaces=yes
+SystemCallArchitectures=native
+SystemCallFilter=@system-service
+Type=simple
+ExecStart=pipewire -c pipewire-ic-ipc.conf
+Restart=on-failure
+RuntimeDirectory=pipewire
+RuntimeDirectoryPreserve=yes
+User=pipewire
+Environment=PIPEWIRE_RUNTIME_DIR=%t/pipewire
+
+[Install]
+Also=pipewire-ic-ipc.socket
+WantedBy=default.target
diff --git a/src/pipewire-ic-ipc.socket b/src/pipewire-ic-ipc.socket
new file mode 100644
index 0000000..3877d4a
--- /dev/null
+++ b/src/pipewire-ic-ipc.socket
@@ -0,0 +1,12 @@
+[Unit]
+Description=PipeWire AGL Instrument Cluster IPC
+
+[Socket]
+Priority=6
+ListenStream=%t/pipewire/icipc-0
+SocketUser=pipewire
+SocketGroup=pipewire
+SocketMode=0660
+
+[Install]
+WantedBy=sockets.target