Tue, 03 Nov 2009 16:05:28 +0100
Handle daemon run time activity on package operations.
postfix-mailgraph/postfix-mailgraph.spec | file | annotate | diff | comparison | revisions |
1.1 --- a/postfix-mailgraph/postfix-mailgraph.spec Mon Nov 02 22:32:28 2009 +0100 1.2 +++ b/postfix-mailgraph/postfix-mailgraph.spec Tue Nov 03 16:05:28 2009 +0100 1.3 @@ -32,7 +32,7 @@ 1.4 Group: Mail 1.5 License: GPL 1.6 Version: 1.14 1.7 -Release: 20091101 1.8 +Release: 20091102 1.9 1.10 # list of sources 1.11 Source0: http://mailgraph.schweikert.ch/pub/mailgraph-%{version}.tar.gz 1.12 @@ -101,3 +101,18 @@ 1.13 %clean 1.14 rm -rf $RPM_BUILD_ROOT 1.15 1.16 +%post 1.17 + # after upgrade, restart service 1.18 + [ $1 -eq 2 ] || exit 0 1.19 + eval `%{l_rc} postfix-mailgraph status 2>/dev/null` 1.20 + [ ".$postfix_mailgraph_active" = .yes ] && %{l_rc} postfix-mailgraph restart 1.21 + exit 0 1.22 + 1.23 +%preun 1.24 + # before erase, stop service and remove log files 1.25 + [ $1 -eq 0 ] || exit 0 1.26 + %{l_rc} postfix-mailgraph stop 2>/dev/null 1.27 + rm -f $RPM_INSTALL_PREFIX/var/postfix-mailgraph/run/*.log* >/dev/null 2>&1 || true 1.28 + rm -f $RPM_INSTALL_PREFIX/var/postfix-mailgraph/run/*.pid >/dev/null 2>&1 || true 1.29 + exit 0 1.30 +