I don't know if that's an issue but I noticed that truncating the logfile (the redirected STDOUT) doesn't work, at least the way expected. When doing
echo '' > out.log
ls -l out.log
ls still shows the old filesize. df shows the diskspace being freed. The logfile contains somehow invisible characters. It seems the open file should be rewinded or seek the beginning again. I work around this with this code at the moment:
Signal.trap('USR2'){ STDOUT.truncate 0 ; STDOUT.rewind }
To reproduce see https://gist.github.com/1564418
I don't know if that's an issue but I noticed that truncating the logfile (the redirected STDOUT) doesn't work, at least the way expected. When doing
lsstill shows the old filesize.dfshows the diskspace being freed. The logfile contains somehow invisible characters. It seems the open file should be rewinded or seek the beginning again. I work around this with this code at the moment:To reproduce see https://gist.github.com/1564418