[sr-dev] git:master:79928c42: Added systemd unit file

Victor Seva linuxmaniac at torreviejawireless.org
Sat Feb 4 10:55:25 CET 2017


Module: kamailio
Branch: master
Commit: 79928c42c60100973dfe4c919b0a34229b803100
URL: https://github.com/kamailio/kamailio/commit/79928c42c60100973dfe4c919b0a34229b803100

Author: Sergey Safarov <s.safarov at gmail.com>
Committer: Victor Seva <linuxmaniac at torreviejawireless.org>
Date: 2017-02-04T10:55:15+01:00

Added systemd unit file

---

Modified: pkg/kamailio/centos/7/kamailio.spec

---

Diff:  https://github.com/kamailio/kamailio/commit/79928c42c60100973dfe4c919b0a34229b803100.diff
Patch: https://github.com/kamailio/kamailio/commit/79928c42c60100973dfe4c919b0a34229b803100.patch

---

diff --git a/pkg/kamailio/centos/7/kamailio.spec b/pkg/kamailio/centos/7/kamailio.spec
index 27b86a4..8ac20c4 100644
--- a/pkg/kamailio/centos/7/kamailio.spec
+++ b/pkg/kamailio/centos/7/kamailio.spec
@@ -540,9 +540,17 @@ make install-modules-all skip_modules="app_mono db_cassandra db_oracle \
     kradius kredis ksctp ksnmpstats ksqlite ktls kunixodbc kutils \
     kwebsocket kxml kxmpp"
 
+%if "%{?_unitdir}" == ""
+# On RedHat 6 like
 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
+%else
+# systemd
+install -d %{buildroot}%{_unitdir}
+install -Dpm 0644 pkg/kamailio/centos/%{?centos}/kamailio.service %{buildroot}%{_unitdir}/kamailio.service
+install -Dpm 0644 pkg/kamailio/centos/%{?centos}/kamailio.tmpfiles %{buildroot}%{_tmpfilesdir}/kamailio.conf
+%endif
 
 mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/sysconfig
 install -m644 pkg/kamailio/centos/%{?centos}/kamailio.sysconfig \
@@ -695,8 +703,13 @@ fi
 
 %dir %attr(-,kamailio,kamailio) %{_sysconfdir}/kamailio
 %config(noreplace) %{_sysconfdir}/kamailio/*
-%config %{_sysconfdir}/rc.d/init.d/*
 %config %{_sysconfdir}/sysconfig/*
+%if "%{?_unitdir}" == ""
+%config %{_sysconfdir}/rc.d/init.d/*
+%else
+%{_unitdir}/kamailio.service
+%{_tmpfilesdir}/kamailio.conf
+%endif
 
 %dir %{_libdir}/kamailio
 %{_libdir}/kamailio/libprint.so




More information about the sr-dev mailing list