How to change the default permissions of the "sar" logs when it is created by sysstat?

Solution Verified - Updated -

Environment

  • Red Hat Enterprise Linux (RHEL) 5, 6, 7

Issue

  • How to change the default permissions of the sar logs when it is created by sysstat?

Resolution

  • Edit /usr/lib64/sa/sa1 and /usr/lib64/sa/sa2 to set the required umask.
  • For example: set the following umask to create sar files with 600 permission.

    umask 0077
    

Note : The sa1 and sa2 files are part of the sysstat package, therefore these changes will be overwritten when sysstat package is updated or re-installed.

This will only affect new generated files in /var/log/sa/

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

1 Comments

This is not working in RHEL7. Post changes :

echo "umask 0027" >> /etc/sysconfig/sysstat

it only worked till reboot. Post reboot back to earlier. Any idea why?