Commit e23e7c15 authored by Daniel Henninger's avatar Daniel Henninger Committed by dhenninger

[JM-1211] Improved service handling in RPM (uninstalls and upgrades)


git-svn-id: http://svn.igniterealtime.org/svn/repos/openfire/trunk@9661 b35dd754-fafc-0310-a699-88a17e54d16e
parent c762c461
...@@ -76,14 +76,21 @@ rm -rf $RPM_BUILD_ROOT%{homedir}/resources/spank ...@@ -76,14 +76,21 @@ rm -rf $RPM_BUILD_ROOT%{homedir}/resources/spank
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%preun %preun
[ -x "/etc/init.d/openfire" ] && /etc/init.d/openfire stop if [ "$1" == "0" ]; then
if [ "$1" != 0 ]; then # This is an uninstall, instead of an upgrade.
/sbin/chkconfig --del openfire /sbin/chkconfig --del openfire
[ -x "/etc/init.d/openfire" ] && /etc/init.d/openfire stop
fi fi
%post %post
/sbin/chkconfig --add openfire
chown -R daemon:daemon %{homedir} chown -R daemon:daemon %{homedir}
if [ "$1" == "1" ]; then
# This is a fresh install, instead of an upgrade.
/sbin/chkconfig --add openfire
fi
# Trigger a restart.
[ -x "/etc/init.d/openfire" ] && /etc/init.d/openfire condrestart
%files %files
%defattr(-,daemon,daemon) %defattr(-,daemon,daemon)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment