Clearing /var/tmp on boot

Peter Jeremy peterjeremy at
Mon Dec 28 11:41:36 UTC 2009

On 2009-Dec-28 00:22:12 +0100, Jilles Tjoelker <jilles at> wrote:
>Another alternative is to enable /etc/periodic/daily/110.clean-tmps.
>That one is a bit overzealous though, also deleting sockets that are
>still in use.

I wrote a tool for $work that (amongst other things) does periodic
cleanups.  In order to avoid this problem, it uses lsof(8) to confirm
that a candidate for deletion is not in use before deleting it.

It would be nice if there was a system call like unlink(2) which failed
if the file was open...

Peter Jeremy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url :

More information about the freebsd-current mailing list