... won't go away!

Hi Bruce,

I'm trying to use your qlogtools, qfilelog specifically because I want
to use logrotate &  qmail-analog. 

   http://em.ca/~bruceg/qlogtools/

My problem is that qfilelog won't go away when I issue "qmail.init stop"
it's "Process State Code" get changed to "R" (runnable (on run queue))
and it just sits there.

I'm using the scripts that come with the memphis RPM's for qmail v1.03.
They come setup by default for cyclog. Here's the pertinent part of the
script:

As distributed:
===============================================================
supervise $DIR qmail-start "$DEFAULT_DELIVERY" accustamp qmail \
  | setuser $LOGUSER cyclog $FILESIZE $FILENO $LOGDIR &
===============================================================

With my modifications for use of qfilelog:
===============================================================
supervise $DIR qmail-start "$DEFAULT_DELIVERY" accustamp qmail \
 | setuser $LOGUSER qfilelog $LOGFILE &
===============================================================

The commands run fine, no errors reported. I can do a "ps -auxww | grep
qmai" and all is well. The log gets created, etc. The only problem is
when stopping the service.

I can add "killall -TERM qfilelog" to the "stop" portion of the script
and it'll die just fine but that doesn't help if I want to run qfilelog
on the other logs like the ones for qmail-smtpd & pop3... (Which I do!)

I thank you for writing the tools and for posting to the list (I found
your posts with eGroups when I searched for logrotate in the archive.)
Any help you can provide would be greatly appreciated. I've atttached
the whole qmail.init script in case you're not familiar with it.

Any caveats with using qmail-mrtg on qfilelog-produced logfiles? That's
my next task re: qmail...

Thanks for your time,
~Jason

Jason Ingham 
System Administrator 
WebEasy, Inc. 

T: (310) 576-0770 
F: (310) 576-2011 
[EMAIL PROTECTED] 
http://www.webeasy.com
#! /bin/sh -
# $INITDIR/qmail.init
# INITDIR is defined below
# Sun Dec 14 1997 XZ <[EMAIL PROTECTED]> v2.3
#
# chkconfig: 345 80 45
# description:  Start, stop, restart, reload, and otherwise signal qmail \
#               Makes heavy use of parts of DJB's daemontools  package \
#               It also relies upon daemontools.functions for 91.04982% \
#               of the grunt work.

# Do not remove the next line, RH will not function w/o
# killproc action daemon

# customize
QMAILHOME=/var/qmail              # ~qmail
PROG=qmail                        # what program?
DIR=/var/lock/$PROG               # a directory for supervise to use
LOGDIR=/var/log/$PROG             # directory for logs
archiveOGFILE=/var/log/qmail/qm.log
LOGFILE=/var/log/$PROG/qm.log     
LOGUSER=qmaill                    # user to own logs
LOGCONFDIR=/etc/cyclog            # config dir for cyclog
DEFAULT_DELIVERY="`egrep -v "(^#|^ *$)"  $QMAILHOME/defaultdelivery/rc`"  # where to 
deliver mail
USESUBSYS="y"                     # use /var/lock/subsys/$PROG, y/n

INITDIR=/etc/rc.d/init.d          # location of initscripts


# Grab the daemontools init  functions
. $INITDIR/daemontools.functions

FILESIZE=${FILESIZE="-s 1000000"}  # for compatibility, use /etc/cyclog instead;
FILENO=${FILENO="-n 10"}           # see daemontools.functions for more

export PATH=$QMAILHOME/bin:$PATH

start() {
    if check; then
        echo "$PROG is already running"
    else
        echo -n "Starting $PROG..."
        supervise $DIR qmail-start "$DEFAULT_DELIVERY" accustamp qmail \
         | setuser $LOGUSER qfilelog $LOGFILE &

        if [ "$USESUBSYS" = "y" ]; then
           touch /var/lock/subsys/$PROG 
        fi
        
        echo "done"
    fi
}

case "$1" in
    start)
        start
    ;;
    stop)
        stop
##        killall -TERM qfilelog
    ;;
    restart)
        restart
    ;;
    status)
        status
    ;;
    help)
        help
    ;;
    *)
        signal $1
    ;;
esac




Reply via email to