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)