Search code examples
permissionscentosmariadbpidrhel

Change permission mask on MariaDB PID file


MariaDB by default starts and creates the PID file with -rw-rw----:

-rw-rw---- 1 mysql mysql        6 Jul 18 11:38 localhost.localdomain.pid

I need to be able to read this PID file with another user. How can I change the permissions on this file to be created something like -rw-rw-r--? Remember this file is deleted once the DB is shut down and it is created on startup.

I have root permission and everything. I'm using the latest MariaDB version (10.1.14-1.el6) and RHEL 6 and SELinux is off.


Solution

  • Something like this:

    Add to the startup script:

    $ umask 777
    $ chmod 666 localhost.localdomain.pid
    $ umask 770