Why does soft link in /var/log disappear?

Jerry McAllister jerrymc at msu.edu
Mon Feb 15 16:02:46 UTC 2010

On Mon, Feb 15, 2010 at 09:46:09AM -0500, John Almberg wrote:

> I didn't make my /var partition big enough, way back when, and have had 
> to move my /var/log/www directory to another partition. I did this by 
> moving the directory, and then adding a soft link from /var/log to the 
> moved directory, using something like:
> ln -s /home/wwwlog /var/log/www
> This works great, but something is deleting the soft link. 
> Is there anything in the freebsd base that 'cleans up' the /var/log 
> directory? Any hints on how I can discover what is doing this clean up, 
> or a way to protect this link from being deleted?

Do you have log rotation set up?
In order to do a clean copy when the file may still be held open
by the www system, the rotator may delete and recreate the file.
The rotator probably does not pay any attention to it being a link.

This is just a big guess, but something to check on.

I have many directories moved and linked to use other space
and have no problem with it.  It should work, but you may have
to make the log rotator smarter - or change how the directory
tree is set up.    Something like:  don't move and link the 
actual file/directory the logger writes to, but create a directory
above it in the bigger space and then set up configuration to write
to log files within it so there never has to be a link on the actual
files on which the log rotator is working.


> Thanks: John
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org"

More information about the freebsd-questions mailing list