Bug 3904

Summary: Logrotate script contribution for EL7 RPMs
Product: Slurm Reporter: Ole.H.Nielsen <Ole.H.Nielsen>
Component: ContributionsAssignee: Tim Wickberg <tim>
Status: RESOLVED DUPLICATE QA Contact:
Severity: 4 - Minor Issue    
Priority: ---    
Version: 16.05.10   
Hardware: Linux   
OS: Linux   
Site: DTU Physics Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: Target Release: 17.11
DevPrio: --- Emory-Cloud Sites: ---
Attachments: logrotate script for slurmctld, rename as /etc/logrotate.d/slurmctld
Logrotate script for slurmd
Logrotate script for slurmdbd

Description Ole.H.Nielsen@fysik.dtu.dk 2017-06-16 00:58:56 MDT
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.
Comment 1 Ole.H.Nielsen@fysik.dtu.dk 2017-06-16 00:59:54 MDT
Created attachment 4785 [details]
Logrotate script for slurmd
Comment 2 Ole.H.Nielsen@fysik.dtu.dk 2017-06-16 01:00:25 MDT
Created attachment 4786 [details]
Logrotate script for slurmdbd
Comment 3 Tim Wickberg 2017-06-16 15:23:56 MDT
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 ***
Comment 4 Ole.H.Nielsen@fysik.dtu.dk 2017-06-19 01:03:22 MDT
(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.

Thanks,
Ole