Module: kamailio Branch: master Commit: e221ef539d16570840f004c397909441bac58cce URL: https://github.com/kamailio/kamailio/commit/e221ef539d16570840f004c397909441bac58cce
Author: Sergey Safarov <[email protected]> Committer: Sergey Safarov <[email protected]> Date: 2026-01-05T13:23:33+02:00 pkg/kamailio: fixed systemd unit file inititlization --- Added: pkg/kamailio/obs/kamailio.preset Modified: pkg/kamailio/obs/kamailio.spec --- Diff: https://github.com/kamailio/kamailio/commit/e221ef539d16570840f004c397909441bac58cce.diff Patch: https://github.com/kamailio/kamailio/commit/e221ef539d16570840f004c397909441bac58cce.patch --- diff --git a/pkg/kamailio/obs/kamailio.preset b/pkg/kamailio/obs/kamailio.preset new file mode 100644 index 00000000000..25ab2dd2250 --- /dev/null +++ b/pkg/kamailio/obs/kamailio.preset @@ -0,0 +1 @@ +enable kamailio.service diff --git a/pkg/kamailio/obs/kamailio.spec b/pkg/kamailio/obs/kamailio.spec index 4f9a988db31..d57c5be5581 100644 --- a/pkg/kamailio/obs/kamailio.spec +++ b/pkg/kamailio/obs/kamailio.spec @@ -216,6 +216,7 @@ Conflicts: kamailio-xmlrpc < %ver, kamailio-xmpp < %ver Conflicts: kamailio-uuid < %ver Requires: systemd BuildRequires: systemd-devel +BuildRequires: systemd-rpm-macros BuildRequires: bison BuildRequires: cmake BuildRequires: flex @@ -1196,9 +1197,7 @@ kazoo \ %endif lcr \ ldap \ -%if "%{?_unitdir}" != "" log_systemd \ -%endif lost \ %if %{with lwsc} lwsc \ @@ -1252,9 +1251,7 @@ sctp \ siprepo \ slack \ snmpstats \ -%if "%{?_unitdir}" != "" systemdops \ -%endif tls \ %if %{with wolfssl} tls_wolfssl \ @@ -1295,6 +1292,7 @@ rm -f %{buildroot}%{_sysconfdir}/kamailio/pi_framework.xml.sample install -d %{buildroot}%{_sharedstatedir}/kamailio install -d %{buildroot}%{_unitdir} +install -Dpm 0644 pkg/kamailio/obs/kamailio.preset %{buildroot}%{_presetdir}/kamailio.preset install -Dpm 0644 pkg/kamailio/obs/kamailio.service %{buildroot}%{_unitdir}/kamailio.service install -Dpm 0644 pkg/kamailio/obs/[email protected] %{buildroot}%{_unitdir}/[email protected] install -Dpm 0644 pkg/kamailio/obs/kamailio.tmpfiles %{buildroot}%{_tmpfilesdir}/kamailio.conf @@ -1336,28 +1334,15 @@ rm -rf %{buildroot} %post -%if "%{?_unitdir}" == "" -/sbin/chkconfig --add kamailio -%else -%tmpfiles_create kamailio.conf -/usr/bin/systemctl -q enable kamailio.service -%endif +%tmpfiles_create %{name}.conf +%systemd_post %{name}.service %preun -if [ $1 = 0 ]; then -%if "%{?_unitdir}" == "" - /sbin/service kamailio stop > /dev/null 2>&1 - /sbin/chkconfig --del kamailio -%else - %{?systemd_preun kamailio.service} -%endif -fi +%systemd_preun %{name}.service -%if "%{?_unitdir}" == "" %postun -%{?systemd_postun kamailio.service} -%endif +%systemd_postun %{name}.service %files %defattr(-,root,root) @@ -1494,10 +1479,8 @@ fi %doc %{_docdir}/kamailio/modules/README.statsc %doc %{_docdir}/kamailio/modules/README.topos %doc %{_docdir}/kamailio/modules/README.cfgt -%if "%{?_unitdir}" != "" %doc %{_docdir}/kamailio/modules/README.log_systemd %doc %{_docdir}/kamailio/modules/README.systemdops -%endif %dir %attr(-,kamailio,kamailio) %{_sysconfdir}/kamailio %config(noreplace) %{_sysconfdir}/kamailio/dictionary.kamailio @@ -1511,14 +1494,10 @@ fi %else %config %{_sysconfdir}/sysconfig/kamailio %endif -%if "%{?_unitdir}" == "" -%config %{_sysconfdir}/rc.d/init.d/* -%dir %attr(-,kamailio,kamailio) %{_var}/run/kamailio -%else %{_unitdir}/kamailio.service %{_unitdir}/[email protected] +%{_presetdir}/kamailio.preset %{_tmpfilesdir}/kamailio.conf -%endif %dir %{_libdir}/kamailio @@ -1651,10 +1630,8 @@ fi %{_libdir}/kamailio/modules/topos.so %{_libdir}/kamailio/modules/topos_htable.so %{_libdir}/kamailio/modules/cfgt.so -%if "%{?_unitdir}" != "" %{_libdir}/kamailio/modules/log_systemd.so %{_libdir}/kamailio/modules/systemdops.so -%endif %{_sbindir}/kamailio %{_sbindir}/kamctl _______________________________________________ Kamailio - Development Mailing List -- [email protected] To unsubscribe send an email to [email protected] Important: keep the mailing list in the recipients, do not reply only to the sender!
