Bug 874559

Summary: RFE: Need a way to override ExecStart= in unit files, not just add to it which makes little sense
Product: [Fedora] Fedora Reporter: James Withers <james>
Component: systemdAssignee: systemd-maint
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 17CC: james, johannbg, lnykryn, metherid, mschmidt, msekleta, notting, plautrba, systemd-maint, vpavlin
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-15 12:21:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description James Withers 2012-11-08 13:01:55 UTC
Description of problem:

systemd overrides in /etc/systemd/system/name.service cause the service to fail, when the parameters work in /usr/lib/systemd/system/name.service. Failed when trying to customise mysql.service.


Version-Release number of selected component (if applicable):
systemd 0:44-17
mysql-server mysql-server-5.5.28-1


How reproducible: every time


Steps to Reproduce:

1. In /etc/systemd/system/mysql.service, add the following:
        .include /usr/lib/systemd/system/mysqld.service
        [Service]
        LimitNOFILE=100000
        ExecStart=/usr/bin/mysqld_safe --defaults-file=/etc/my.cnf --basedir=/usr

2. systemctl --system daemon-reload
3. service mysqld start
  
Actual results:

[root@localhost sysconfig]# service mysqld start
Redirecting to /bin/systemctl start  mysqld.service
Failed to issue method call: Unit mysqld.service failed to load: Invalid argument. See system logs and 'systemctl status mysqld.service' for details.
[root@localhost sysconfig]# systemctl status mysqld.service
mysqld.service - MySQL database server
	  Loaded: error (Reason: Invalid argument)
	  Active: inactive (dead) since Thu, 08 Nov 2012 08:51:25 +0000; 5min ago
	Main PID: 27719 (code=exited, status=0/SUCCESS)
	  CGroup: name=systemd:/system/mysqld.service

Nov 08 00:45:54 localhost.localdomain mysqld_safe[27719]: 121108 00:45:54 mysqld_safe Logging to '/var/lib/mysql/localhost.localdomain.err'.
Nov 08 00:45:54 localhost.localdomain mysqld_safe[27719]: 121108 00:45:54 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql


Expected results:

MySQL starts up with values specified in /usr/lib/systemd/system/mysql.service


Additional info:

When I set the values from /etc/systemd/system/mysql.service directly in /usr/lib/systemd/system/mysqld.service MySQL starts correctly. As a workaround, I have kept the values in /usr/lib/systemd/system/mysqld.service

Comment 1 Jóhann B. Guðmundsson 2012-11-08 13:54:33 UTC
Parts of systemd might be a bit more tolerant against spelling errors in units which resides under /usr/lib/systemd/system/ directory in anycase the error message more descriptive as in show which argument is considered invalid ( think we have this on the Fit and Finish tracker already )

Comment 2 James Withers 2012-11-08 15:07:35 UTC
Hi Johann,

Where would I get more information other than from systemctl status? I can run the command from the terminal and it works.

Comment 3 Lennart Poettering 2013-01-15 04:45:17 UTC
You currently cannot override ExecStart=. The way you used it above will mean you have two ExecStart='s defined, and that's not allowed.

Comment 4 Michal Schmidt 2013-01-15 12:21:57 UTC
Some ideas to improve the possibilities of overriding have been written in bug 756787.

*** This bug has been marked as a duplicate of bug 756787 ***