LSTSRV-L Archives

LISTSERV Site Administrators' Forum

LSTSRV-L

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Philip Kizer <[log in to unmask]>
Thu, 21 Dec 2000 20:17:30 -0600
text/plain (66 lines)
Paul Russell <[log in to unmask]> wrote:
>Are there any plans to include this functionality in the unix versions of
>the product?  I can craft a homegrown solution, but not without modifying
>the go script, and even then it isn't foolproof.

I would definitely have to agree with the desire for being able to HUP for
rotating logs/etc; then again, I don't remember filing an official RFE to
LSoft, probably time to do so.  It would also be an "interesting" change for
them as logging is just performed via a command-line redirection, no logfile handling in the program itself.

It would be pretty trivial to take one of the perl web loggers that accepts
log-data from STDIN and opens a date-based log-file to send it to; but
that, again, would be modifying 'go'.  If I ever get bored I might
implement that, but bored hasn't been in my vocabulary for a while :)

As for implementing home-grown, here's what we've used for, oh, 6+ years.
You just write a wrapper _around_ 'go', and call that in /etc/rc2.d/S*mumble,
and also from cron every night.  It ain't pretty, but it's functional (it
was inherited and worked, so dont ask for reasoning in the PATH, if that
bored thing comes up again, I'll make sure things are sane without ucb [ick]):

# crontab -l | grep lsv
15 0 * * * /usr/local/sbin/restart-lsv

======== /usr/local/sbin/restart-lsv =======================================
#!/bin/sh
PATH=/bin:/usr/ucb
PIDFILE="/var/spool/listserv/listserv.PID"

CHK=`cat $PIDFILE`
LSVPID=`echo $CHK | awk '{ if($1+0 > 1) print $1; else print "???"; }'`

if [ ".$LSVPID" != ".???" ] ; then
#  echo "-- Sent "terminate" signal to process $LSVPID."
  kill -TERM $LSVPID
  sleep 10
fi

#echo "-- Restarting LSV."
su - listserv -c "go bg"
sleep 60
renice -10 "`cat $PIDFILE`" > /dev/null 2>&1

###
LOG_DIR=/logs/listserv
LOG=listserv.log
cd $LOG_DIR

test -f $LOG.5.gz && mv $LOG.5.gz $LOG.6.gz
test -f $LOG.4.gz && mv $LOG.4.gz $LOG.5.gz
test -f $LOG.3.gz && mv $LOG.3.gz $LOG.4.gz
test -f $LOG.2.gz && mv $LOG.2.gz $LOG.3.gz
test -f $LOG.1.gz && mv $LOG.1.gz $LOG.2.gz
test -f $LOG.0.gz && mv $LOG.0.gz $LOG.1.gz
mv $LOG.OLD   $LOG.0
/public/bin/gzip -9 $LOG.0
=======================================


-philip

--
Philip Kizer,
USENIX Liaison to Texas A&M University       <[log in to unmask]>
Texas A&M CIS Operating Systems Group, Unix <[log in to unmask]>

ATOM RSS1 RSS2