Bug 768594

Summary: mysqld.service is overwritten on update losing LimitNOFILE
Product: [Fedora] Fedora Reporter: ziggyh
Component: mysqlAssignee: Tom Lane <tgl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 16CC: hhorak, tgl
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-17 16:00:44 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description ziggyh 2011-12-17 10:20:27 UTC
Description of problem:
In order to increase the amount of open files allowed in mysql, one has to enter LimitNOFILE in mysqld.service as the value of open-files-limit is not read from my.cnf any more. On upgrading mysql, the mysqld.service file is overwritten, losing any changes.

Version-Release number of selected component (if applicable):
Any version included in fc14 onwards.

How reproducible:
Always on upgrade/update.

Steps to Reproduce:
1.Edit mysqld.service adding LimitNOFILE (or supposedly anything else)
2.Upgrade to newer version
3.
  
Actual results:
Changes are lost as the mysqld.service file is overwritten.

Expected results:
Changes are kept and mysqld.service is created as .rpmnew or similar.

Additional info:
This has happened on fc14/fc15/fc16.
I am unsure if this should be classified under mysql or systemd, but I have chosen the former assuming this could be fixed in the packaging of said RPM.

Comment 1 Tom Lane 2011-12-17 16:00:44 UTC
This is not a bug; you are not supposed to modify systemd service files directly.  The correct procedure for making a custom service definition is to create your own file in /lib/systemd/system/.  You can just copy-and-paste the system-supplied version, but it's probably a better plan to "include" the supplied version and then define just the settings you need.

Comment 2 Honza Horak 2011-12-19 08:50:24 UTC
(In reply to comment #1)
> The correct procedure for making a custom service definition is to
> create your own file in /lib/systemd/system/.

This was a typo probably, you should use /etc/systemd/system/ for your locally modified unit files. For more info see:
https://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F