|
You don't often get email from ms...@rice.edu.
Learn why this is important
|
Hi Mang,
From my experience, the lorgotate copytruncate option does not work reliably with ArchivesSpace 3.~ under RHEL9. The JVM keeps the logfile open and continues writing through the existing file descriptor after Logrotate truncates the file. Because the application does not reopen its log file, rotation can result in missing, malformed, or otherwise unusable log data, and the file continues to grow in size. ArchivesSpace also does not appear to safely support SIGHUP-based log reopening; my testing showed that sending SIGHUP caused the application to terminate. As a result, the most reliable approach for us was to stop the service before rotation and restart it afterward, as exhibited in the prerotate and postrotate options in my example below.
/opt/archivesspace/logs/archivesspace.out {
monthly
maxsize 1024M
rotate 8
dateext
compress
notifempty
missingok
prerotate
/opt/archivesspace/archivesspace.sh stop > /dev/null 2>&1
endscript
postrotate
/opt/archivesspace/archivesspace.sh start > /dev/null 2>&1
endscript
}
References:
https://linux.die.net/man/8/logrotate
https://unix.stackexchange.com/questions/117852/logrotate-wont-truncate-original-file
Thanks,
Stan Otken
Client Technologies Analyst
Library Technology Services
Mary and Jeff Bell Library
Texas A&M University-Corpus Christi