Bug 874559 - RFE: Need a way to override ExecStart= in unit files, not just add to it which makes little sense
RFE: Need a way to override ExecStart= in unit files, not just add to it whic...
Status: CLOSED DUPLICATE of bug 756787
Product: Fedora
Classification: Fedora
Component: systemd (Show other bugs)
x86_64 Linux
unspecified Severity medium
: ---
: ---
Assigned To: systemd-maint
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-11-08 08:01 EST by James Withers
Modified: 2013-01-15 07:21 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-01-15 07:21:57 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description James Withers 2012-11-08 08:01:55 EST
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
        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 08:54:33 EST
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 10:07:35 EST
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-14 23:45:17 EST
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 07:21:57 EST
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 ***

Note You need to log in before you can comment on or make changes to this bug.