OpenPKG CVS Repository
  http://cvs.openpkg.org/
  ____________________________________________________________________________

  Server: cvs.openpkg.org                  Name:   Michael van Elst
  Root:   /e/openpkg/cvs                   Email:  [EMAIL PROTECTED]
  Module: openpkg-src openpkg-web          Date:   23-Jul-2003 10:33:29
  Branch: HEAD                             Handle: 2003072309332801

  Modified files:
    openpkg-src/sendmail    rc.sendmail sendmail.spec
    openpkg-web             news.txt

  Log:
    %status and pidfile handling, use simple 'rc reload' for logfile
    rotation

  Summary:
    Revision    Changes     Path
    1.19        +43 -45     openpkg-src/sendmail/rc.sendmail
    1.91        +1  -1      openpkg-src/sendmail/sendmail.spec
    1.5740      +1  -0      openpkg-web/news.txt
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: openpkg-src/sendmail/rc.sendmail
  ============================================================================
  $ cvs diff -u -r1.18 -r1.19 rc.sendmail
  --- openpkg-src/sendmail/rc.sendmail  22 Jul 2003 08:11:10 -0000      1.18
  +++ openpkg-src/sendmail/rc.sendmail  23 Jul 2003 08:33:29 -0000      1.19
  @@ -12,9 +12,6 @@
       sendmail_flags_out="-q60s"
       sendmail_flags_msp="-Ac -q60s"
       sendmail_flags=""
  -    sendmail_pidfile_in="@l_prefix@/var/sendmail/sendmail.in.pid"
  -    sendmail_pidfile_out="@l_prefix@/var/sendmail/sendmail.out.pid"
  -    sendmail_pidfile_msp="@l_prefix@/var/sendmail/clientmqueue/sendmail.msp.pid"
       sendmail_log_prolog="true"
       sendmail_log_epilog="true"
       sendmail_log_numfiles="10"
  @@ -22,6 +19,9 @@
       sendmail_log_complevel="9"
   
   %common
  +    sendmail_pidfile_in="@l_prefix@/var/sendmail/sendmail.in.pid"
  +    sendmail_pidfile_out="@l_prefix@/var/sendmail/sendmail.out.pid"
  +    sendmail_pidfile_msp="@l_prefix@/var/sendmail/clientmqueue/sendmail.msp.pid"
       sendmail_start () {
           if rcService sendmail enable yes; then
               @l_prefix@/sbin/sendmail $sendmail_flags_in $sendmail_flags \
  @@ -33,24 +33,39 @@
           fi
       }
       sendmail_signal () {
  -        if rcService sendmail enable yes; then
  -            if [ -f $sendmail_pidfile_in ]; then
  -                rpmtool signal -c -d2 \
  -                    -p `head -1 $sendmail_pidfile_in` "$@"
  -                rm -f $sendmail_pidfile_in
  -            fi
  -            if [ -f $sendmail_pidfile_out ]; then
  -                rpmtool signal -c -d2 \
  -                    -p `head -1 $sendmail_pidfile_out` "$@"
  -                rm -f $sendmail_pidfile_out
  -            fi
  -            if [ -f $sendmail_pidfile_msp ]; then
  -                rpmtool signal -c -d2 \
  -                    -p `head -1 $sendmail_pidfile_msp` "$@"
  -                rm -f $sendmail_pidfile_msp
  -            fi
  -        fi
  +        local rc
  +        [ -f $sendmail_pidfile_in ] \
  +        && kill -$1 `cat $sendmail_pidfile_in`
  +        rc=$?
  +        [ -f $sendmail_pidfile_out ] \
  +        && kill -$1 `cat $sendmail_pidfile_out` \
  +        && [ $rc -eq 0 ]
  +        rc=$?
  +        [ -f $sendmail_pidfile_msp ] \
  +        && kill -$1 `cat $sendmail_pidfile_msp` \
  +        && [ $rc -eq 0 ]
  +    }
  +    sendmail_wait1 () {
  +        local i=0
  +        while [ $i -lt $sendmail_wait_timeout -a -f $1 ]; do
  +            sleep 1
  +        done
  +        rm -f $1 2>/dev/null || true
       }
  +    sendmail_wait () {
  +        sendmail_wait1 $sendmail_pidfile_in
  +        sendmail_wait1 $sendmail_pidfile_out
  +        sendmail_wait1 $sendmail_pidfile_msp
  +    }
  +
  +%status -u @l_susr@ -o
  +    sendmail_usable="unknown"
  +    sendmail_active="no"
  +    rcService sendmail enable yes && \
  +        sendmail_signal 0 && sendmail_active="yes"
  +    echo "sendmail_enable=\"$sendmail_enable\""
  +    echo "sendmail_usable=\"$sendmail_usable\""
  +    echo "sendmail_active=\"$sendmail_active\""
   
   %start -u @l_susr@
       rcService sendmail enable yes || exit 0
  @@ -58,45 +73,28 @@
   
   %stop -u @l_susr@
       rcService sendmail enable yes || exit 0
  -    sendmail_signal TERM KILL
  +    sendmail_signal TERM
  +    sendmail_wait
   
   %restart -u @l_susr@
       rcService sendmail enable yes || exit 0
  -    sendmail_signal TERM KILL
  -    sleep 2
  +    sendmail_signal TERM
  +    sendmail_wait
       sendmail_start
   
   %reload -u @l_susr@
       rcService sendmail enable yes || exit 0
  -    #   sendmail does not like SIGHUP on queue-only processes,
  -    #   so we have to perform actually a restart...
  -    sendmail_signal TERM KILL
  -    sleep 2
  +    sendmail_signal TERM
  +    sendmail_wait
       sendmail_start
   
   %daily -u @l_susr@
       rcService sendmail enable yes || exit 0
  -    rcTmp -i -p sendmail
  -    hintfile=`rcTmp -f -n hint`
  -    prolog="true"
  -    if [ ".$sendmail_log_prolog" != . ]; then
  -        prolog="$prolog; $sendmail_log_prolog"
  -    fi
  -    epilog="echo 'epilog' >$hintfile"
  -    if [ ".$sendmail_log_epilog" != . ]; then
  -        epilog="$epilog; $sendmail_log_epilog"
  -    fi
       shtool rotate -f \
           -n ${sendmail_log_numfiles} -s ${sendmail_log_minsize} \
           -d -z ${sendmail_log_complevel} \
           -o @l_musr@ -g @l_mgrp@ -m 644 \
  -        -P "$prolog" \
  -        -E "$epilog" \
  +        -P "$sendmail_log_prologue" \
  +        -E "$sendmail_log_epilogue && rc sendmail reload" \
           @l_prefix@/var/sendmail/sendmail.log
  -    if [ ".`cat $hintfile`" = ".epilog" ]; then
  -        sendmail_signal TERM KILL
  -        sleep 2
  -        sendmail_start
  -    fi
  -    rcTmp -k
   
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-src/sendmail/sendmail.spec
  ============================================================================
  $ cvs diff -u -r1.90 -r1.91 sendmail.spec
  --- openpkg-src/sendmail/sendmail.spec        22 Jul 2003 08:11:10 -0000      1.90
  +++ openpkg-src/sendmail/sendmail.spec        23 Jul 2003 08:33:29 -0000      1.91
  @@ -33,7 +33,7 @@
   Group:        Mail
   License:      BSD
   Version:      8.12.9
  -Release:      20030722
  +Release:      20030723
   
   #   package options
   %option       with_fsl      yes
  @@ .
  patch -p0 <<'@@ .'
  Index: openpkg-web/news.txt
  ============================================================================
  $ cvs diff -u -r1.5739 -r1.5740 news.txt
  --- openpkg-web/news.txt      23 Jul 2003 08:25:29 -0000      1.5739
  +++ openpkg-web/news.txt      23 Jul 2003 08:33:28 -0000      1.5740
  @@ -1,3 +1,4 @@
  +23-Jul-2003: Upgraded package: P<sendmail-8.12.9-20030723>
   23-Jul-2003: Upgraded package: P<rt-3.0.4-20030723>
   23-Jul-2003: Upgraded package: P<inn-2.4.0-20030723>
   23-Jul-2003: Upgraded package: P<teapop-0.3.7-20030723>
  @@ .
______________________________________________________________________
The OpenPKG Project                                    www.openpkg.org
CVS Repository Commit List                     [EMAIL PROTECTED]

Reply via email to