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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Database Discussions' 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:
    42,782
    Likes Received:
    1,712
    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.
     
  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:
    42,782
    Likes Received:
    1,712
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Are you using MySQL or MariaDB on this system?

    Thank you.
     
  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:
    42,782
    Likes Received:
    1,712
    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.
     
Loading...

Share This Page