[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openpkg-dev
Subject:    [OpenPKG #236] CORE and BASE packages should use consistent %post restart logic
From:       "Michael Schloh v. Bennewitz via RT" <openpkg-rt () openpkg ! org>
Date:       2003-08-14 10:14:33
[Download RAW message or body]

Request 236 was acted upon.
_________________________________________________________________________

         URL: https://rt.openpkg.org/id/236
      Ticket: [OpenPKG #236]
     Subject: CORE and BASE packages should use consistent %post restart logic
  Requestors: ms@openpkg.org
       Queue: openpkg
       Owner: ms
      Status: new
 Transaction: Ticket creado por ms
        Time: Jue. Ago. 14 12:14:32 2003
_________________________________________________________________________

CORE and BASE daemon packages should use the same %post restart logic as found in \
PLUS, EVAL, and JUNK damon packages.

This protects against the hard to diagnose page swap segfault, which theoretically \
could occur during installation while the daemon is running. However, it also ensures \
a consistent approach across all daemon packages.

# correct restart procedure in .spec files
%pre
    #   before upgrade, save status and stop service
    [ $1 -eq 2 ] || exit 0
    eval `%{l_rc} FOO status 2>/dev/null | tee %{l_tmpfile}`
    %{l_rc} FOO stop 2>/dev/null
    exit 0

%post
    if [ $1 -eq 2 ]; then
        #   after upgrade, restore status
        eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile}
        [ ".$FOO_active" = .yes ] && %{l_rc} FOO start
    fi
    exit 0

%preun
    #   before erase, stop service and remove log files
    [ $1 -eq 0 ] || exit 0
    %{l_rc} FOO stop 2>/dev/null
    rm -f $RPM_INSTALL_PREFIX/var/FOO/*.log* >/dev/null 2>&1 || true
    exit 0

-- 
Michael Schloh v. Bennewitz
OpenPKG Developer
ms@openpkg.org

______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
Developer Communication List                   openpkg-dev@openpkg.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic