cassandranosqllogbackcassandra-3.0

How can I update the permissions on Cassandra system.log?


when configured through logback.xml, by default system.log was created with permission set -rw-r----- with cassandra user having ownership. For exporting logs tried updating -rw-r--r-- to 644 permission, But on logrotation that was reverted by cassandra.

Anyway the privilege for these files can be updated through configuration?


Solution

  • This isn't really a Cassandra question but a filesystem security issue.

    Your server has strict permissions for newly-created files. In Unix, the user file-creation mode mask (umask) determines the permissions when files get created -- Logback doesn't set the permissions so it is not configurable through logback.xml.

    You need to update the default umask for the Cassandra user so permissions are not so restrictive. The default umask is usually set to 022 so the owner has read/write/execute permissions (0), and everyone else has read access (2).

    The default umask is typically configured in the following locations:

    You can check the current setting by running:

    $ umask
    

    You can set default umask for Cassandra by adding it to ~/.bashrc or ~/.bash_profile, for example:

    umask 022
    

    If you need assistance, consult your sysadmin team. Cheers!


    👉 Please support the Apache Cassandra community by hovering over the tag then click on the Watch tag button. 🙏 Thanks!