Date: Wed, 17 May 2000 08:16:18 +0200 From: Marc Silver <marcs@draenor.org> To: Doug Barton <DougB@gorean.org> Cc: freebsd-questions@freebsd.org Subject: Re: "Hangup" in mail from cron Message-ID: <20000517081618.G58332@draenor.org> In-Reply-To: <39223554.E45081A@gorean.org>; from DougB@gorean.org on Tue, May 16, 2000 at 10:59:48PM -0700 References: <Pine.BSF.4.21.0005161231480.53178-100000@dt051n0b.san.rr.com> <20000517074925.F58332@draenor.org> <39223554.E45081A@gorean.org>
next in thread | previous in thread | raw e-mail | index | archive | help
Looking at your shell script, I can't see offhand why it's failing.
Below you can find the shell script I'm using to rotate log files. Give
it a try and see if this gives you the "hangup" error.
#!/bin/sh
sleep 1
DATESTR=`/usr/local/bin/date -d yesterday +%Y%m%d`
if [ -f "/var/log/apache/httpd.$DATESTR.log" ]; then
echo "Log files have already being rotated today - quitting."
exit 1
fi
if [ -f "/var/log/apache/httpd.$DATESTR.log.gz" ]; then
echo "Log files have already being rotated AND compressed today - quitting."
exit 1
fi
mv /stats/logs/httpd-log /stats/logs/httpd.$DATESTR.log
mv /stats/logs/httpd-errors /stats/logs/httpd-errors.$DATESTR.log
#Restarting Server.
/usr/local/sbin/apachectl restart
# End of script
Hope this helps,
Cheers,
Marc
On Tue, May 16, 2000 at 10:59:48PM -0700, Doug Barton wrote:
> Marc Silver wrote:
> >
> > What are you running from cron?
>
> Yeah, I realized that I neglected that detail in my post. :) I'm
> running a script that I wrote to rotate web server logs. Here is the
> relevant part of one of the scripts:
>
> if [ -n "${PID}" ]; then
> kill -HUP $PID
> else
> echo "Couldn't HUP $PID"
> ps -auxww | grep httpd | grep -v grep
>
> /usr/local/sbin/apachectl stop
> /usr/local/sbin/apachectl start
> fi
>
> The odd thing is, it is actually doing the kill. But for some reason
> it's also sending the word "Hangup" as if something generated output on
> stderr.
>
> Doug
> --
> "Live free or die"
> - State motto of my ancestral homeland, New Hampshire
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000517081618.G58332>
