[slurm-users] Correct way to do logrotation

708 views
Skip to first unread message

Taras Shapovalov

unread,
Oct 16, 2023, 5:25:14 AM10/16/23
to Slurm User Community List
Hello,

In the past it was recommended to reconfigure slurm daemons in logrotate script, sending a signal I believe was also the way to go. But recently I retested manual logrotation and I see that a removal of log file (for slurmctld, slurmdbd or slurmd) does not affect the logging of the daemons. The dameons just recreate the log files and continue to write logs there. What is the right way to go in case of the modern Slurm versions?

Best regards,

Taras

Davide DelVento

unread,
Oct 17, 2023, 10:27:25 AM10/17/23
to Slurm User Community List
I'd be interested in this too, and I'm reposting only because the message was flagged as both "dangerous email" and "spam", so people may not have seen it (hopefully my reply will not suffer the same downfall...)

Groner, Rob

unread,
Oct 17, 2023, 10:53:05 AM10/17/23
to Slurm User Community List
Thanks for doing that, as I did not see this original message, and I also am having to look at configuring our log for rotation.  We once accidentally turned on debug5 and didn't notice until other things started failing because the drive was full...from that ONE file.

I did find this conversation about it, but haven't had a chance to try it.

https://groups.google.com/g/slurm-users/c/WZfyVh2CXK8?pli=1

Rob


From: slurm-users <slurm-use...@lists.schedmd.com> on behalf of Davide DelVento <davide....@gmail.com>
Sent: Tuesday, October 17, 2023 10:26 AM
To: Slurm User Community List <slurm...@lists.schedmd.com>
Subject: Re: [slurm-users] Correct way to do logrotation
 

Timony, Mick

unread,
Oct 17, 2023, 11:09:57 AM10/17/23
to Slurm User Community List
Schedmd has docs about how to do this at:

https://slurm.schedmd.com/slurm.conf.html#SECTION_LOGGING


Our config at HMS looks like this:


/var/log/slurm/slurmctld.log {
  create 0640 slurm root
  daily
  dateext
  nocompress
  notifempty
  rotate 10
  sharedscripts
  postrotate
    /bin/pkill -x --signal SIGUSR2 slurmctld >/dev/null 2>&1
  endscript
  prerotate
    /bin/sh /usr/local/bin/pre_rotate.sh >/dev/null 2>&1
  endscript
}

Our pre_rotate scripts rsync's the logs to an NFS mount.

Cheers
--Mick


From: slurm-users <slurm-use...@lists.schedmd.com> on behalf of Davide DelVento <davide....@gmail.com>
Sent: Tuesday, October 17, 2023 10:26 AM
To: Slurm User Community List <slurm...@lists.schedmd.com>
Subject: Re: [slurm-users] Correct way to do logrotation
 
Reply all
Reply to author
Forward
0 new messages