Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Permanently modify /etc/systemd/system/mysql.service

Discussion in 'Database Discussion' started by gersonfs, Apr 3, 2018.

  1. gersonfs

    gersonfs Active Member

    Joined:
    Sep 30, 2007
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    56
    Hello

    I need to permanently modify /etc/systemd/system/mysql.service, more precisely the settings ProtectSystem = false and ProtectHome = false
    I changed this file and executed systemctl daemon-reload
    But I missed the changes tonight, I believe it's due to an update. How do I make these changes permanent?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    You should be able to add a separate configuration file. EX:

    Code:
    touch /etc/systemd/system/mysqld.service.d/protect.conf
    chmod 0600 /etc/systemd/system/mysqld.service.d/protect.conf
    Code:
    # cat /etc/systemd/system/mysqld.service.d/protect.conf
    [Service]
    ProtectHome=false
    ProtectSystem=false
    Let us know if that helps.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. gersonfs

    gersonfs Active Member

    Joined:
    Sep 30, 2007
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    56
    Thanks, it should help!
     
  4. gersonfs

    gersonfs Active Member

    Joined:
    Sep 30, 2007
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    56
    It only worked after put this file on /etc/systemd/system/mariadb.service.d
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Are you using MySQL or MariaDB on this system?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. gersonfs

    gersonfs Active Member

    Joined:
    Sep 30, 2007
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    56
    MariaDB. Sorry, I forgot to report it.
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    43,711
    Likes Received:
    1,794
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Yes, if you are using MariaDB, then /etc/systemd/system/mariadb.service.d/ is the correct location to add the include file.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice