Can anyone tell me how they do it.
I realize this is not a snowflake proxy problem. I used the golang way to build the proxy so I followed their instructions to the letter. All those efforts are posted in the thread “A follow up question about Snowflake”.
Doing this using an independent logrotate configuration outside of the /etc/logrotate.conf system.
I use -verbose because I like to see what is going on like where are all the clients from, use time, durations, etc. I have an idea that they are mostly rucnir.
My first attempt resulted in a new file being created (snowflake.log) but the proxy kept writing to the rotated snowflake.1 file while the new one stayed at 0 Kib. Reading the docs again, I realized I needed copytruncate as an option. Reset and boot.
A few hours later, at midnight, it resulted in a new file with as many starting NULLs in it as the original file it replaced followed by entries starting at 00:01:40 UTC. At 00:55 I kill the proxy and restart. It seems the proxy retains the pointer to the next writing position in the file.
A bit of digging and deduction tells me their instructions may be wrong and the command to create a log file:
nohup ./proxy >snowflake.log 2>&1 &
should be append to file:
nohup ./proxy >> snowflake.log 2>&1 &
Midnight will tell me if I am right.
I also had to change their @reboot statement
from:
@reboot nohup /home/snowflake/snowflake/proxy/proxy > /home/snowflake/snowflake/proxy/snowflake.log 2>&1 &
to:
@reboot sleep 180 && nohup /home/snowflake/snowflake/proxy/proxy >> /home/snowflake/snowflake/proxy/snowflake.log 2>&1 &
Their way the proxy process starts too early and the system is not fully up so it cannot find the peer broker since DNS is not ready yet.
My logrotate file:
copytruncate
“/home/bob/snowflake.log” {
daily
rotate 15
missingok
notifempty
}