Module: kamailio
Branch: master
Commit: 56df10c585b3354826b164fb84b34c2120d2bf8e
URL:
https://github.com/kamailio/kamailio/commit/56df10c585b3354826b164fb84b34c2…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: GitHub <noreply(a)github.com>
Date: 2017-02-15T07:27:07+01:00
Merge pull request #988 from sergey-safarov/spec_update6
pkg/kamailio/centos: Set of improvements
---
Modified: pkg/kamailio/centos/7/kamailio.service
Modified: pkg/kamailio/centos/7/kamailio.spec
---
Diff:
https://github.com/kamailio/kamailio/commit/56df10c585b3354826b164fb84b34c2…
Patch:
https://github.com/kamailio/kamailio/commit/56df10c585b3354826b164fb84b34c2…
---
diff --git a/pkg/kamailio/centos/7/kamailio.service
b/pkg/kamailio/centos/7/kamailio.service
index 66945f4..40b4b99 100644
--- a/pkg/kamailio/centos/7/kamailio.service
+++ b/pkg/kamailio/centos/7/kamailio.service
@@ -4,14 +4,22 @@ After=network.target
[Service]
Type=forking
+WorkingDirectory=/run/kamailio
Environment='CFGFILE=/etc/kamailio/kamailio.cfg'
+Environment='SHM_MEMORY=64'
+Environment='PKG_MEMORY=8'
EnvironmentFile=/etc/sysconfig/kamailio
# PIDFile requires a full absolute path
-PIDFile=/var/run/kamailio.pid
+PIDFile=/run/kamailio/kamailio.pid
# ExecStart requires a full absolute path
-ExecStart=/usr/sbin/kamailio -P /var/run/kamailio.pid -f $CFGFILE -m $SHM_MEMORY -M
$PKG_MEMORY -u $USER -g $GROUP
-ExecStopPost=/usr/bin/rm -f /var/run/kamailio.pid
+ExecStart=/usr/sbin/kamailio -P /run/kamailio/kamailio.pid -f $CFGFILE -m $SHM_MEMORY -M
$PKG_MEMORY
+ExecStopPost=/usr/bin/rm -f /run/kamailio/kamailio.pid
Restart=on-abort
+User=kamailio
+Group=daemon
+; For each TCP or TLS endpoint connection is requred file descriptor
+LimitNOFILE=99999
+
[Install]
WantedBy=multi-user.target
diff --git a/pkg/kamailio/centos/7/kamailio.spec b/pkg/kamailio/centos/7/kamailio.spec
index 3281184..4458ad1 100644
--- a/pkg/kamailio/centos/7/kamailio.spec
+++ b/pkg/kamailio/centos/7/kamailio.spec
@@ -222,8 +222,8 @@ json string handling and RPC modules for Kamailio.
%package kazoo
Summary: Kazoo middle layer connector support for Kamailio
Group: System Environment/Daemons
-Requires: libuuid, kamailio = %ver
-BuildRequires: rabbitmq-c-devel, json-c-devel, libuuid-devel
+Requires: libuuid, rabbitmq-c, json-c, libevent, kamailio = %ver
+BuildRequires: libuuid-devel, rabbitmq-c-devel, json-c-devel, libevent-devel
%description kazoo
Kazoo module for Kamailio.
@@ -593,6 +593,7 @@ make install-modules-all skip_modules="app_mono db_cassandra
db_oracle \
%if "%{?_unitdir}" == ""
# On RedHat 6 like
+install -d %{buildroot}%{_rundir}/kamailio
mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d
install -m755 pkg/kamailio/centos/%{?centos}/kamailio.init \
$RPM_BUILD_ROOT/%{_sysconfdir}/rc.d/init.d/kamailio
@@ -622,7 +623,12 @@ rm -rf "$RPM_BUILD_ROOT"
%post
+%if "%{?_unitdir}" == ""
/sbin/chkconfig --add kamailio
+%else
+%tmpfiles_create kamailio.conf
+/usr/bin/systemctl -q enable kamailio.service
+%endif