[sr-dev] git:master: pkg/kamailio/fedora: Improvements to service script and .spec

Peter Dunkley peter.dunkley at crocodile-rcs.com
Sat Jun 2 01:50:11 CEST 2012


Module: sip-router
Branch: master
Commit: 54404016cb6863339021eb6790d79911823db624
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=54404016cb6863339021eb6790d79911823db624

Author: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Committer: Peter Dunkley <peter.dunkley at crocodile-rcs.com>
Date:   Sat Jun  2 00:48:29 2012 +0100

pkg/kamailio/fedora: Improvements to service script and .spec

- systemd service script now deletes PID file and restarts Kamailio
  automatically if it fails due to an unhandled signal.
- Updated .spec to call "systemctl --system daemon-reload" after uninstall

---

 pkg/kamailio/fedora/16/kamailio.service |    2 ++
 pkg/kamailio/fedora/16/kamailio.spec    |    9 +++++++++
 2 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/pkg/kamailio/fedora/16/kamailio.service b/pkg/kamailio/fedora/16/kamailio.service
index 3aa65c7..a8d59b0 100644
--- a/pkg/kamailio/fedora/16/kamailio.service
+++ b/pkg/kamailio/fedora/16/kamailio.service
@@ -7,6 +7,8 @@ Type=forking
 EnvironmentFile=/etc/sysconfig/kamailio
 PIDFile=/var/run/kamailio.pid
 ExecStart=/usr/sbin/kamailio -P /var/run/kamailio.pid $OPTIONS
+ExecStopPost=/usr/bin/rm -f /var/run/kamailio.pid
+Restart=on-abort
 
 [Install]
 WantedBy=multi-user.target
diff --git a/pkg/kamailio/fedora/16/kamailio.spec b/pkg/kamailio/fedora/16/kamailio.spec
index 78ba9d9..6abcfd2 100644
--- a/pkg/kamailio/fedora/16/kamailio.spec
+++ b/pkg/kamailio/fedora/16/kamailio.spec
@@ -423,6 +423,13 @@ fi
 
 
 
+%postun
+%if 0%{?fedora}
+/bin/systemctl --system daemon-reload
+%endif
+
+
+
 %files
 %defattr(-,root,root)
 %dir %{_docdir}/kamailio
@@ -907,6 +914,8 @@ fi
 
 
 %changelog
+* Sat Jun 2 2012 Peter Dunkley <peter at dunkley.me.uk>
+  - Added %postun section to reload systemd on Fedora after uninstall
 * Fri Jun 1 2012 Peter Dunkley <peter at dunkley.me.uk>
   - Tweak to the pkg/kamailio/fedora directory structure
   - Tested with Fedora 17




More information about the sr-dev mailing list