From owner-freebsd-questions Tue May 16 23:16:35 2000 Delivered-To: freebsd-questions@freebsd.org Received: from draenor.org (draenor.org [196.36.119.129]) by hub.freebsd.org (Postfix) with ESMTP id DB1C037B54A for ; Tue, 16 May 2000 23:16:28 -0700 (PDT) (envelope-from marcs@draenor.org) Received: from marcs by draenor.org with local (Exim 3.13 #1) id 12rx7y-000FnU-00; Wed, 17 May 2000 08:16:18 +0200 Date: Wed, 17 May 2000 08:16:18 +0200 From: Marc Silver To: Doug Barton Cc: freebsd-questions@freebsd.org Subject: Re: "Hangup" in mail from cron Message-ID: <20000517081618.G58332@draenor.org> References: <20000517074925.F58332@draenor.org> <39223554.E45081A@gorean.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <39223554.E45081A@gorean.org>; from DougB@gorean.org on Tue, May 16, 2000 at 10:59:48PM -0700 X-Operating-System: FreeBSD 4.0-STABLE Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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