Module: kamailio
Branch: master
Commit: 9f9ec197e029dca44ac57575b214a32916c838cb
URL:
https://github.com/kamailio/kamailio/commit/9f9ec197e029dca44ac57575b214a32…
Author: Yasin CANER <caner_yaso(a)hotmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2019-02-01T19:23:56+01:00
src/Makefile: added target to install files for systemd on Centos 7 (#1831)
* src/Makefile: added target to install files for systemd on Centos 7
added target to install systemd and sysconfig files for systemd service
installation method : make install-systemd-centos
* src/makefile : add --system parameter for user
src/makefile : add --system parameter for user
after rebooting , /run/kamailio folder is survived.
---
Modified: src/Makefile
---
Diff:
https://github.com/kamailio/kamailio/commit/9f9ec197e029dca44ac57575b214a32…
Patch:
https://github.com/kamailio/kamailio/commit/9f9ec197e029dca44ac57575b214a32…
---
diff --git a/src/Makefile b/src/Makefile
index 593da28166..cd772c877b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -1041,6 +1041,28 @@ install_systemd_debian install-systemd-debian:
@echo "* to enable kamailio service run:"
@echo " systemctl enable kamailio"
@echo " systemctl daemon-reload"
+.PHONY: install_systemd_centos install-systemd-centos
+install_systemd_centos install-systemd-centos:
+ 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/sysconfig/kamailio#EnvironmentFile=-/etc/sysconfig/$(NAME)#g"
\
+ -e
"s#CFGFILE=/etc/kamailio/kamailio.cfg#CFGFILE=$(cfg_prefix)/$(cfg_dir)$(NAME).cfg#g"
\
+ < ../pkg/kamailio/obs/kamailio.service \
+ > /etc/systemd/system/$(NAME).service
+ cp ../pkg/kamailio/obs/kamailio.sysconfig \
+ /etc/sysconfig/$(NAME)
+ mkdir -p /var/run/$(NAME)
+ chmod 0700 /var/run/$(NAME)
+ groupadd --system $(NAME)
+ useradd $(NAME) --system --shell /sbin/nologin -g $(NAME) --home /var/run/$(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 daemon-reload"
+ @echo " systemctl enable kamailio"
+ @echo " systemctl start kamailio"
.PHONY: dbschema
dbschema: