Module: kamailio
Branch: 5.2
Commit: 9ead1778f6df817192b9cbf805169895bb647035
URL:
https://github.com/kamailio/kamailio/commit/9ead1778f6df817192b9cbf80516989…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-02-01T08:17:53+01:00
src/Makefile: added target to install files for systemd on debian
* make install-systemd-debian
(cherry picked from commit ddbf18352f189b8aa1ae5e5f1d83d42db6fcc0d2)
---
Modified: src/Makefile
---
Diff:
https://github.com/kamailio/kamailio/commit/9ead1778f6df817192b9cbf80516989…
Patch:
https://github.com/kamailio/kamailio/commit/9ead1778f6df817192b9cbf80516989…
---
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:
-@echo "Build database schemas"