Date: Mon, 5 Jun 2000 09:23:27 -0400 From: "Troy Settle" <troy@picus.com> To: "Jeff Gray" <jwg2@adsl-63-201-55-220.dsl.snfc21.pacbell.net>, <freebsd-questions@FreeBSD.ORG> Subject: RE: df - du leakage Message-ID: <NIEBLEDADLBOBAJFKPHDGEGDCAAA.troy@picus.com> In-Reply-To: <Pine.BSF.4.10.10006050600001.19198-100000@adsl-63-201-55-220.dsl.snfc21.pacbell.net>
next in thread | previous in thread | raw e-mail | index | archive | help
Jeff, I'm suprised you didn't see a couple different threads from me having smililar problems. What's happening is this: Something moves/renames/deletes an open log file. The filename is gone, but the inode is never released. In fact, the process that has the file open will continue to write to it. Killing the process *after* the fact doesn't work in all situations because the inode and file still exist, even if it's not in the directory listing. Trust me, I've had this happen, and in an attempt to fix it, I'v e taken down *every* process possible, and nothing worked. I had to boot to single user mode and run an fsck manually. If you want to rotate a log file manually or from your own script, you need to follow a few rules. I'll use apache for an example: #!/bin/sh foo=`date +'%Y%m%d'` # rename the file mv /var/log/httpd-access.log /var/log/httpd-access.$foo # tell apache to close/reopen it's files kill -HUP `cat /var/run/httpd.pid` # do what you will with the now-out-of-service log file webalize /var/log/httpd-access.$foo [gzip|rm|mv] /var/log/httpd-access.$foo [/some/other/location] Other programs might behave differently. For example, (cistron) radiusd opens and closes it's files for every write. You can safely delete the detail files without causing damage to the filesystem, though I would reccomend that you rename it first (the next write will create a new detail file). HTH, -Troy ** -----Original Message----- ** From: owner-freebsd-questions@FreeBSD.ORG ** [mailto:owner-freebsd-questions@FreeBSD.ORG]On Behalf Of Jeff Gray ** Sent: Monday, June 05, 2000 9:08 AM ** To: freebsd-questions@FreeBSD.ORG ** Subject: df - du leakage ** ** ** Could not find an answer in the archives, good explanations of what is ** going on by Doug Barton but no hint on how to find the difference. ** ** I have been monitoring the difference between ** df [Used storage on /var mount point] ** and ** du /var ** ** The difference in result is fine, but the difference is growing. ** That is, ** more and more of /var is being Used according to df, which apparently ** shows the correct amount as it monitors the fs. du is not telling me ** where the leakage is occuring. ** ** I assume if one can find the process that is doing this then the process ** can be killed, freeing the space again from the fs. ** ** Thanks in advance ** Jeff ** ** ** ** ** To Unsubscribe: send mail to majordomo@FreeBSD.org ** with "unsubscribe freebsd-questions" in the body of the message ** 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?NIEBLEDADLBOBAJFKPHDGEGDCAAA.troy>