I'm trying to rotate OpenVPNs logfiles every month. The problem seems to be that simply renaming the files doesn't do the trick. The data still gets written to the old file (which indicates that the logfile is kept open and logging still writes to the old file object).
So now I wrote a script that restarts openvpn at the beginning of every month after it updates a symlink to the new log file's location.
But this script seems to be buggy and sometimes fails to start the server correctly (tun0 is down sometimes).
So I wanted to ask if one of you knows a better way to achieve log rotation in OpenVPN?
Edit: I'm using Debian Squeeze and my restart script already sleeps 5 seconds between stopping and starting the