Red Hat Bugzilla – Bug 874559
RFE: Need a way to override ExecStart= in unit files, not just add to it which makes little sense
Last modified: 2013-01-15 07:21:57 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):
How reproducible: every time
Steps to Reproduce:
1. In /etc/systemd/system/mysql.service, add the following:
ExecStart=/usr/bin/mysqld_safe --defaults-file=/etc/my.cnf --basedir=/usr
2. systemctl --system daemon-reload
3. service mysqld start
[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)
Nov 08 00:45:54 localhost.localdomain mysqld_safe: 121108 00:45:54 mysqld_safe Logging to '/var/lib/mysql/localhost.localdomain.err'.
Nov 08 00:45:54 localhost.localdomain mysqld_safe: 121108 00:45:54 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
MySQL starts up with values specified in /usr/lib/systemd/system/mysql.service
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
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 )
Where would I get more information other than from systemctl status? I can run the command from the terminal and it works.
You currently cannot override ExecStart=. The way you used it above will mean you have two ExecStart='s defined, and that's not allowed.
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 ***