Ticket 4041

Summary: slurmctld does not reopen file specified in AccountingStorageLoc when receiving SIGHUP
Product: Slurm Reporter: Giovanni Torres <git0rr-slurm>
Component: AccountingAssignee: Jacob Jenson <jacob>
Status: RESOLVED INVALID QA Contact:
Severity: 6 - No support contract    
Priority: ---    
Version: 17.02.6   
Hardware: Linux   
OS: Linux   
Site: -Other- 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: ---
DevPrio: --- Emory-Cloud Sites: ---

Description Giovanni Torres 2017-08-01 02:48:08 MDT
Overview
=========

slurmctld does not rotate the accounting file specified in AccountingStorageLoc, when AccountingStorageType is set to accounting_storage/filetxt. scontrol reconfigure also ignores the accounting file. It seems restarting is the only way to force slurmctld to reopen the file.

https://slurm.schedmd.com/accounting.html seems pretty clear that SIGHUP should re-open the file and recommends to use logrotate for the accounting file.

Steps to Reproduce:
===================

1. Run slurmctld with AccountingStorageType=accounting_storage/filetxt and AccountingStorageLoc=/var/log/slurm/accounting.log
2. Move the file /var/log/slurm/accounting.log to /var/log/slurm/accounting.log.1 and create a new one with the right permissions
3. Send SIGHUP to the slurmctld process

Actual Results:
===============

slurmctld continues writing to /var/log/slurm/accounting.log.1

Expected Results:
=================

slurmctld writes to the newly created file /var/log/slurm/accounting.log as specified in AccountingStorageLoc.

Build Date & Hardware:
======================

slurm 17.02.6 on Ubuntu 16.04.2

Additional Builds and Platforms:
================================

Not tested