[sr-dev] git:master:ddbf1835: src/Makefile: added target to install files for systemd on debian

Daniel-Constantin Mierla miconda at gmail.com
Thu Jan 31 20:02:52 CET 2019


Module: kamailio
Branch: master
Commit: ddbf18352f189b8aa1ae5e5f1d83d42db6fcc0d2
URL: https://github.com/kamailio/kamailio/commit/ddbf18352f189b8aa1ae5e5f1d83d42db6fcc0d2

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2019-01-31T20:02:26+01:00

src/Makefile: added target to install files for systemd on debian

* make install-systemd-debian

---

Modified: src/Makefile

---

Diff:  https://github.com/kamailio/kamailio/commit/ddbf18352f189b8aa1ae5e5f1d83d42db6fcc0d2.diff
Patch: https://github.com/kamailio/kamailio/commit/ddbf18352f189b8aa1ae5e5f1d83d42db6fcc0d2.patch

---

diff --git a/src/Makefile b/src/Makefile
index 5b67d7ad67..593da28166 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1019,6 +1019,29 @@ install_initd_centos install-initd-centos:
                   -d /var/run/$(NAME) $(NAME)
 	chown $(NAME):$(NAME) /var/run/$(NAME)
 
+.PHONY: install_systemd_debian install-systemd-debian
+install_systemd_debian install-systemd-debian:
+	sed -e "s#ExecStart=/usr/sbin/kamailio#ExecStart=$(bin_prefix)/$(bin_dir)$(NAME)#g" \
+		-e "s#Description=Kamailio#Description=$(NAME)#g" \
+		-e "s#/var/run/kamailio/kamailio.pid#/var/run/$(NAME)/$(NAME).pid#g" \
+		-e "s#EnvironmentFile=-/etc/default/kamailio#EnvironmentFile=-/etc/default/$(NAME)#g" \
+		-e "s#CFGFILE=/etc/kamailio/kamailio.cfg#CFGFILE=$(cfg_prefix)/$(cfg_dir)$(NAME).cfg#g" \
+		< ../pkg/kamailio/deb/debian/kamailio.service \
+		> /etc/systemd/system/$(NAME).service
+	sed -e "s#RUN_KAMAILIO=no#RUN_KAMAILIO=yes#g" \
+		< ../pkg/kamailio/deb/debian/kamailio.default \
+		> /etc/default/$(NAME)
+	mkdir -p /var/run/$(NAME)
+	adduser --quiet --system --group --disabled-password \
+        --shell /bin/false --gecos "$(NAME)" \
+        --home /var/run/$(NAME) $(NAME)
+	chown $(NAME):$(NAME) /var/run/$(NAME)
+	echo "D /run/$(NAME) 0700 $(NAME) $(NAME) -" > /etc/tmpfiles.d/$(NAME).conf
+	@echo
+	@echo "* to enable kamailio service run:"
+	@echo "    systemctl enable kamailio"
+	@echo "    systemctl daemon-reload"
+
 .PHONY: dbschema
 dbschema:
 	- at echo "Build database schemas"




More information about the sr-dev mailing list