Procházet zdrojové kódy

add missing pre/post install run command logic

Michael Schloh von Bennewitz před 22 roky
rodič
revize
519956c168
1 změnil soubory, kde provedl 11 přidání a 3 odebrání
  1. 11 3
      cacti/cacti.spec

+ 11 - 3
cacti/cacti.spec

@@ -33,7 +33,7 @@ Distribution: OpenPKG [EVAL]
 Group:        Database
 License:      GPL
 Version:      0.8.4
-Release:      20031205
+Release:      20031208
 
 #   list of sources
 Source0:      http://www.raxnet.net/downloads/cacti-%{version}.tar.gz
@@ -191,10 +191,18 @@ AutoReqProv:  no
           echo "   password to a custom one."
         ) | %{l_rpmtool} msg -b -t notice
     fi
+    if [ $1 -eq 2 ]; then
+        #   after upgrade, restart service
+        eval `%{l_rc} cacti status 2>/dev/null`
+        [ ".$cacti_active" = .yes ] && %{l_rc} cacti restart
+    fi
+    exit 0
 
 %preun
     if [ $1 -eq 0 ]; then
-        #   remove generated logfiles
-        rm -f $RPM_INSTALL_PREFIX/var/cacti/log/*
+        #   before erase, stop service and remove log files
+        %{l_rc} cacti stop 2>/dev/null
+        rm -f $RPM_INSTALL_PREFIX/var/cacti/log/* >/dev/null 2>&1 || true
     fi
+    exit 0