Created attachment 4784 [details]
logrotate script for slurmctld, rename as /etc/logrotate.d/slurmctld
The log /var/log/slurm/slurmctld.log rapidly grows to a big size, and I assume that all Slurm sites will eventually need to implement a standard logrotate script. This is unfortunately missing in the slurm* RPMs for CentOS 7.
I'd like to contribute the attached simple /etc/logrotate.d/slurmctld script. It can be trivially adapted for slurmd and slurmdbd as well. It does a weekly log rotation and compresses the old log, reloading also the slurmctld as recommended in https://bugs.schedmd.com/show_bug.cgi?id=3402#c4.
The daemon reloading command is specific for Systemd based Linuxes, for Init based systems replace by "service slurmctld reload".
I propose including the /etc/logrotate.d/slurmctld script in the RPMs such as slurm-17.02.*.el7.centos.x86_64.rpm together with the slurmctld daemon file. Please add a prerequisite for the "logrotate" RPM in the slurm.spec file.
Created attachment 4785 [details]
Logrotate script for slurmd
Created attachment 4786 [details]
Logrotate script for slurmdbd
FYI - the bottom of the slurm.conf man page has outlined this for some time; but I could see some value in adding these as examples.
Bug 2215 has been open for a while to discuss this; I'm closing this as a duplicate.
*** This bug has been marked as a duplicate of bug 2215 ***
(In reply to Tim Wickberg from comment #3)
> FYI - the bottom of the slurm.conf man page has outlined this for some time;
> but I could see some value in adding these as examples.
Thanks, I never found that example, and it's not really a topic related to slurm.conf.
We agree that a logrotate.conf file is a Good Thing. My point is rather a suggestion to incorporate logrotate.conf in the slurm.spec file so that it gets installed by default with the slurm-* RPM.
In https://bugs.schedmd.com/show_bug.cgi?id=3396 you refer to an upcoming overhaul of slurm.spec for 17.11, and my suggestion is to add the logrotate item to the TODO list in that process.
BTW, it's common practice for RPMs installing daemon services to include by default a logrotate file. A list will be found in /etc/logrotate.d/ on any RHEL/CentOS system.