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

gersonfs

Active Member
Sep 30, 2007
41
0
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?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
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.