From 9cd3cc7f001ab5d5b4f43570ff35a82ebb31e91b Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Mon, 1 Aug 2022 14:15:07 +0200 Subject: [PATCH] TT#186700 systemd template units Change-Id: Ic04ede985da5f239a6dae6515340a43a0426ad9d --- debian/generate-systemd-templates.sh | 8 ++++++++ debian/ngcp-rtpengine-daemon.links | 2 ++ debian/ngcp-rtpengine-recording-daemon.links | 2 ++ debian/rules | 3 +++ 4 files changed, 15 insertions(+) create mode 100755 debian/generate-systemd-templates.sh diff --git a/debian/generate-systemd-templates.sh b/debian/generate-systemd-templates.sh new file mode 100755 index 000000000..15751f663 --- /dev/null +++ b/debian/generate-systemd-templates.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# generate templates +for i in ngcp-rtpengine-daemon ngcp-rtpengine-recording-daemon; do + sed \ + -e 's:daemon\.pid:daemon.%i.pid:g' \ + -e 's:/etc/rtpengine/:/etc/rtpengine_%i/:g' \ + $i.service > $i@.service +done diff --git a/debian/ngcp-rtpengine-daemon.links b/debian/ngcp-rtpengine-daemon.links index 37055f8ee..4e84c6eae 100644 --- a/debian/ngcp-rtpengine-daemon.links +++ b/debian/ngcp-rtpengine-daemon.links @@ -1,2 +1,4 @@ /lib/systemd/system/ngcp-rtpengine-daemon.service /lib/systemd/system/rtpengine-daemon.service /lib/systemd/system/ngcp-rtpengine-daemon.service /lib/systemd/system/rtpengine.service +/lib/systemd/system/ngcp-rtpengine-daemon@.service /lib/systemd/system/rtpengine-daemon@.service +/lib/systemd/system/ngcp-rtpengine-daemon@.service /lib/systemd/system/rtpengine@.service diff --git a/debian/ngcp-rtpengine-recording-daemon.links b/debian/ngcp-rtpengine-recording-daemon.links index a4b875211..e8e30d57d 100644 --- a/debian/ngcp-rtpengine-recording-daemon.links +++ b/debian/ngcp-rtpengine-recording-daemon.links @@ -1,2 +1,4 @@ /lib/systemd/system/ngcp-rtpengine-recording-daemon.service /lib/systemd/system/rtpengine-recording-daemon.service /lib/systemd/system/ngcp-rtpengine-recording-daemon.service /lib/systemd/system/rtpengine-recording.service +/lib/systemd/system/ngcp-rtpengine-recording-daemon@.service /lib/systemd/system/rtpengine-recording-daemon@.service +/lib/systemd/system/ngcp-rtpengine-recording-daemon@.service /lib/systemd/system/rtpengine-recording@.service diff --git a/debian/rules b/debian/rules index 5e25b7503..8b1164190 100755 --- a/debian/rules +++ b/debian/rules @@ -30,6 +30,9 @@ endif %: dh $@ +execute_before_dh_auto_configure: + (cd debian && sh generate-systemd-templates.sh) + execute_before_dh_auto_install-indep: # Create the directories to install the source into dh_installdirs -p$(pdkms) usr/src/$(sname)-$(sversion)