[sr-dev] git:master: Makefile: added install-initd-centos target

Daniel-Constantin Mierla miconda at gmail.com
Mon Jun 3 23:23:58 CEST 2013


Module: sip-router
Branch: master
Commit: 5bed1c2f9721405d5e6e0678f583aee474d4b9b9
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=5bed1c2f9721405d5e6e0678f583aee474d4b9b9

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Mon Jun  3 23:23:15 2013 +0200

Makefile: added install-initd-centos target

- install centos specific init.d scripts

---

 Makefile |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 4f2de07..898f99e 100644
--- a/Makefile
+++ b/Makefile
@@ -1038,6 +1038,26 @@ install_initd_debian install-initd-debian:
         --home /var/run/$(NAME) $(NAME)
 	chown $(NAME):$(NAME) /var/run/$(NAME)
 
+.PHONY: install_initd_centos install-initd-centos
+install_initd_centos install-initd-centos:
+	sed -e "s#KAM=/usr/sbin/kamailio#KAM=$(bin_prefix)/$(bin_dir)$(NAME)#g" \
+		-e "s#PROG=kamailio#PROG=$(NAME)#g" \
+		-e "s#DEFAULTS=/etc/default/kamailio#DEFAULTS=/etc/default/$(NAME)#g" \
+		-e "s#PID_FILE=/var/run/kamailio.pid#PID_FILE=/var/run/$(NAME).pid#g" \
+		-e "s#LOCK_FILE=/var/lock/subsys/kamailio#LOCK_FILE=/var/lock/subsys/$(NAME)#g" \
+		-e "s#KAMCFG=/etc/kamailio/kamailio.cfg#KAMCFG=$(cfg_prefix)/$(cfg_dir)$(NAME).cfg#g" \
+		< pkg/kamailio/rpm/kamailio.init \
+		> /etc/init.d/$(NAME)
+	chmod +x /etc/init.d/$(NAME)
+	sed -e "s#RUN_KAMAILIO=no#RUN_KAMAILIO=yes#g" \
+		-e "s#USER=kamailio#USER=$(NAME)#g" \
+		-e "s#GROUP=kamailio#GROUP=$(NAME)#g" \
+		< pkg/kamailio/rpm/kamailio.default \
+		> /etc/default/$(NAME)
+	/usr/sbin/groupadd -r $(NAME)
+	/usr/sbin/useradd -r -g $(NAME) -s /bin/false -c "Kamailio Daemon" \
+                  -d ${lib_prefix}/${lib_dir} $(NAME)
+
 .PHONY: dbschema
 dbschema:
 	- at echo "Build database schemas"




More information about the sr-dev mailing list