[opensuse] despite override, mythbackend still requires mysql
I have two new mythtv backend systems. The mythbackend service unit requires mysql: # systemctl cat mythbackend # /usr/lib/systemd/system/mythbackend.service [Unit] Description=MythTV backend service After=network.target mysql.service Requires=mysql.service Wants=apache2.service [Service] Type=simple EnvironmentFile=/etc/sysconfig/mythbackend User=mythtv Group=video [snip] In my case, the database runs on a 3rd system, so to save some memory I don't want to keep it running locally too. I added this override: # /etc/systemd/system/mythbackend.service.d/extra.conf [Unit] After= After=network.target Requires= I've done a 'daemon-reload', yet when I stop mysql, mythbackend is still stopped and when I start mythbackend, I also still get mysql started. I am clearly missing something, but I cannot spot it? -- Per Jessen, Zürich (0.8°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
Per Jessen wrote:
I've done a 'daemon-reload', yet when I stop mysql, mythbackend is still stopped and when I start mythbackend, I also still get mysql started. I am clearly missing something, but I cannot spot it?
On stackexchange.com, I came across this: "Dependencies (After=, etc.) cannot be reset to an empty list, so dependencies can only be added in drop-ins. If you want to remove dependencies, you have to override the entire unit." So I have to override the entire unit, i.e. create /etc/systemd/system/mythbackend.service Problem solved. -- Per Jessen, Zürich (3.1°C) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
On Fri, 03 Jan 2020 10:59:32 +0100 Per Jessen <per@computer.org> wrote:
Per Jessen wrote:
I've done a 'daemon-reload', yet when I stop mysql, mythbackend is still stopped and when I start mythbackend, I also still get mysql started. I am clearly missing something, but I cannot spot it?
On stackexchange.com, I came across this:
"Dependencies (After=, etc.) cannot be reset to an empty list, so dependencies can only be added in drop-ins. If you want to remove dependencies, you have to override the entire unit."
So I have to override the entire unit, i.e. create
/etc/systemd/system/mythbackend.service
Problem solved.
Ah I wondered about that possibility and spent a little time searching the documentation but couldn't find anything about it. The only thing I found were statements saying that you COULD use an empty string to override some other directive(s). Having said that I now just found at the bottom of https://www.freedesktop.org/software/systemd/man/systemd.unit.html "Note that for drop-in files, if one wants to remove entries from a setting that is parsed as a list (and is not a dependency), such as AssertPathExists= (or e.g. ExecStart= in service units), one needs to first clear the list before re-adding all entries except the one that is to be removed. Dependencies (After=, etc.) cannot be reset to an empty list, so dependencies can only be added in drop-ins. If you want to remove dependencies, you have to override the entire unit." So I guess it is there. Dunno why I found it so hard to find yesterday. Anyway, well done on solving it. :) -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org
participants (2)
-
Dave Howorth
-
Per Jessen