Michael Schloh von Bennewitz 22 anos atrás
pai
commit
b172772efc
3 arquivos alterados com 41 adições e 5 exclusões
  1. 1 1
      pound/fsl.pound
  2. 17 3
      pound/pound.spec
  3. 23 1
      pound/rc.pound

+ 1 - 1
pound/fsl.pound

@@ -9,7 +9,7 @@ ident (pound)/.+ q{
     -> {
         debug: file(
             path="@l_prefix@/var/pound/pound.log",
-            perm=0644
+            perm=0660, jitter=1, monitor=3600
         )
     }
 };

+ 17 - 3
pound/pound.spec

@@ -33,7 +33,7 @@ Distribution: OpenPKG [EVAL]
 Group:        Web
 License:      GPL
 Version:      1.5
-Release:      20031014
+Release:      20031113
 
 #   package options
 %option       with_fsl  yes
@@ -55,8 +55,8 @@ PreReq:       pcre, openssl, openssl::with_threads = yes
 BuildPreReq:  pth, pth::with_pthread = yes
 PreReq:       pth, pth::with_pthread = yes
 %if "%{with_fsl}" == "yes"
-BuildPreReq:  fsl >= 1.2.0
-PreReq:       fsl >= 1.2.0
+BuildPreReq:  fsl >= 1.3.0
+PreReq:       fsl >= 1.3.0
 %endif
 AutoReq:      no
 AutoReqProv:  no
@@ -149,3 +149,17 @@ AutoReqProv:  no
 %clean
     rm -rf $RPM_BUILD_ROOT
 
+%post
+    #   after upgrade, restart service
+    [ $1 -eq 2 ] || exit 0
+    eval `%{l_rc} pound status 2>/dev/null`
+    [ ".$pound_active" = .yes ] && %{l_rc} pound restart
+    exit 0
+
+%preun
+    #   before erase, stop service and remove log files
+    [ $1 -eq 0 ] || exit 0
+    %{l_rc} pound stop 2>/dev/null
+    rm -f $RPM_INSTALL_PREFIX/var/pound/*.log* >/dev/null 2>&1 || true
+    exit 0
+

+ 23 - 1
pound/rc.pound

@@ -11,15 +11,37 @@
     pound_log_minsize="1M"
     pound_log_complevel="9"
 
+%common
+    pound_pidfile="@l_prefix@/var/pound/pound.pid"
+    pound_signal () {
+        [ -f $pound_pidfile ] && kill -$1 `cat $pound_pidfile`
+    }
+
+%status -u @l_susr@ -o
+    pound_usable="unknown"
+    pound_active="no"
+    rcService pound enable yes && \
+        pound_signal 0 && pound_active="yes"
+    echo "pound_enable=\"$pound_enable\""
+    echo "pound_usable=\"$pound_usable\""
+    echo "pound_active=\"$pound_active\""
+
 %start -u @l_susr@
     rcService pound enable yes || exit 0
+    rcService pound active yes && exit 0
     @l_prefix@/sbin/pound
 
 %stop -u @l_susr@
     rcService pound enable yes || exit 0
-    kill -TERM `cat @l_prefix@/var/pound/pound.pid`
+    rcService pound active no && exit 0
+    pound_signal TERM
     sleep 1
 
+%restart -u @l_susr@
+    rcService pound enable yes || exit 0
+    rcService pound active no && exit 0
+    rc pound stop start
+
 %daily -u @l_susr@
     rcService pound enable yes || exit 0
     shtool rotate -f \