Skip to content
Snippets Groups Projects
Commit 65d8984d authored by Jupiter Hu's avatar Jupiter Hu
Browse files

fixed slurm log rotate config for centos 7

parent cb548979
No related branches found
No related tags found
No related merge requests found
......@@ -37,3 +37,9 @@
template: src=slurmlog.j2 dest=/etc/logrotate.d/slurm mode=644
sudo: true
- name: add slurm db log rotate config
template: src=slurmdblog.j2 dest=/etc/logrotate.d/slurmdb mode=644
sudo: true
delegate_to: "{{ slurmctrl }}"
{{ slurmdbdlog.log }}
{% endif %}
{
compress
missingok
nocopytruncate
nocreate
nodelaycompress
nomail
notifempty
noolddir
rotate 5
sharedscripts
size=5M
create 640 slurm root
{% if ansible_os_family == 'RedHat' and ansible_distribution_version >= '7' %}
postrotate
{{ slurm_dir }}/sbin/slurmdbd flushlogs 1>/dev/null || true
{% else %}
postrotate /etc/init.d/slurmdbd reconfig
{% endif %}
endscript
}
{{ slurmddebug.log }}/slurm*.log
{% if slurmctrl == inventory_hostname %}
{{ slurmctlddebug.log }}
{{ slurmschedlog.log }}
{% else *}
{{ slurmddebug.log }}
{% endif %}
{
compress
missingok
......@@ -12,18 +17,12 @@
sharedscripts
size=5M
create 640 slurm root
{% if slurmctrl == inventory_hostname %}
{% if ansible_os_family == 'RedHat' and ansible_distribution_version >= '7' %}
systemctl restart slurmdbd
{% else %}
postrotate /etc/init.d/slurmdbd reconfig
{% endif %}
{% endif %}
{% if ansible_os_family == 'RedHat' and ansible_distribution_version >= '7' %}
postrotate
{% if slurmctrl == inventory_hostname %}
systemctl restart slurmctld
{{ slurm_dir }}/sbin/slurmctld flushlogs 1>/dev/null || true
{% else %}
systemctl restart slurmd
{{ slurm_dir }}/sbin/slurmd flushlogs 1>/dev/null || true
{% endif %}
{% else %}
postrotate /etc/init.d/slurm reconfig
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment