Browse code

Makefile: added install-initd-centos target

- install centos specific init.d scripts

Daniel-Constantin Mierla authored on 03/06/2013 21:23:15
Showing 1 changed files
... ...
@@ -1038,6 +1038,26 @@ install_initd_debian install-initd-debian:
1038 1038
         --home /var/run/$(NAME) $(NAME)
1039 1039
 	chown $(NAME):$(NAME) /var/run/$(NAME)
1040 1040
 
1041
+.PHONY: install_initd_centos install-initd-centos
1042
+install_initd_centos install-initd-centos:
1043
+	sed -e "s#KAM=/usr/sbin/kamailio#KAM=$(bin_prefix)/$(bin_dir)$(NAME)#g" \
1044
+		-e "s#PROG=kamailio#PROG=$(NAME)#g" \
1045
+		-e "s#DEFAULTS=/etc/default/kamailio#DEFAULTS=/etc/default/$(NAME)#g" \
1046
+		-e "s#PID_FILE=/var/run/kamailio.pid#PID_FILE=/var/run/$(NAME).pid#g" \
1047
+		-e "s#LOCK_FILE=/var/lock/subsys/kamailio#LOCK_FILE=/var/lock/subsys/$(NAME)#g" \
1048
+		-e "s#KAMCFG=/etc/kamailio/kamailio.cfg#KAMCFG=$(cfg_prefix)/$(cfg_dir)$(NAME).cfg#g" \
1049
+		< pkg/kamailio/rpm/kamailio.init \
1050
+		> /etc/init.d/$(NAME)
1051
+	chmod +x /etc/init.d/$(NAME)
1052
+	sed -e "s#RUN_KAMAILIO=no#RUN_KAMAILIO=yes#g" \
1053
+		-e "s#USER=kamailio#USER=$(NAME)#g" \
1054
+		-e "s#GROUP=kamailio#GROUP=$(NAME)#g" \
1055
+		< pkg/kamailio/rpm/kamailio.default \
1056
+		> /etc/default/$(NAME)
1057
+	/usr/sbin/groupadd -r $(NAME)
1058
+	/usr/sbin/useradd -r -g $(NAME) -s /bin/false -c "Kamailio Daemon" \
1059
+                  -d ${lib_prefix}/${lib_dir} $(NAME)
1060
+
1041 1061
 .PHONY: dbschema
1042 1062
 dbschema:
1043 1063
 	-@echo "Build database schemas"