Skip to content

Commit

Permalink
src/Makefile: added target to install files for systemd on Centos 7 (#…
Browse files Browse the repository at this point in the history
…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.

(cherry picked from commit 9f9ec19)
  • Loading branch information
ycaner06 authored and miconda committed Mar 6, 2019
1 parent ae05d4c commit 55540fd
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 55540fd

Please sign in to comment.