Forráskód Böngészése

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
Peter Dunkley 13 éve
szülő
commit
54404016cb

+ 2 - 0
pkg/kamailio/fedora/16/kamailio.service

@@ -7,6 +7,8 @@ Type=forking
 EnvironmentFile=/etc/sysconfig/kamailio
 EnvironmentFile=/etc/sysconfig/kamailio
 PIDFile=/var/run/kamailio.pid
 PIDFile=/var/run/kamailio.pid
 ExecStart=/usr/sbin/kamailio -P /var/run/kamailio.pid $OPTIONS
 ExecStart=/usr/sbin/kamailio -P /var/run/kamailio.pid $OPTIONS
+ExecStopPost=/usr/bin/rm -f /var/run/kamailio.pid
+Restart=on-abort
 
 
 [Install]
 [Install]
 WantedBy=multi-user.target
 WantedBy=multi-user.target

+ 9 - 0
pkg/kamailio/fedora/16/kamailio.spec

@@ -423,6 +423,13 @@ fi
 
 
 
 
 
 
+%postun
+%if 0%{?fedora}
+/bin/systemctl --system daemon-reload
+%endif
+
+
+
 %files
 %files
 %defattr(-,root,root)
 %defattr(-,root,root)
 %dir %{_docdir}/kamailio
 %dir %{_docdir}/kamailio
@@ -907,6 +914,8 @@ fi
 
 
 
 
 %changelog
 %changelog
+* Sat Jun 2 2012 Peter Dunkley <[email protected]>
+  - Added %postun section to reload systemd on Fedora after uninstall
 * Fri Jun 1 2012 Peter Dunkley <[email protected]>
 * Fri Jun 1 2012 Peter Dunkley <[email protected]>
   - Tweak to the pkg/kamailio/fedora directory structure
   - Tweak to the pkg/kamailio/fedora directory structure
   - Tested with Fedora 17
   - Tested with Fedora 17