`apache2.service` and `openqa-webui.service` wrongly started by `openqa-worker.service`
openqa-gru through deps) are wrongly started by
openqa-worker.service due to:
Wants=apache2.service openqa-webui.service network.target
There is no reason to start apache and openQA webui when we just want to run a worker.
Especially when cache servcie is used, we currently need
fetchneedles script from
openQA package. So, all (remote) workers will start unneeded additional services.
- Status changed from New to In Progress
- Assignee set to mkittler
- Target version set to Current Sprint
Yes, that dependency seems wrong in general as it only makes sense when the worker is configured to connect to the local web UI. Getting rid of it shouldn't matter because the worker will try to reconnect every 10 seconds anyways.
The dependencies have been added a very long time ago:
commit 55a8d9be1 Author: Michal Hrusecky <Michal@Hrusecky.net> Date: Tue Apr 8 11:09:17 2014 +0200 Start workers after webui even without apache diff --git a/systemd/openqa-worker@.service b/systemd/openqa-worker@.service index a199f58eb..ee065307d 100644 --- a/systemd/openqa-worker@.service +++ b/systemd/openqa-worker@.service @@ -4,8 +4,8 @@ # replace '1' with the instance number you want [Unit] Description=openQA Worker #%i -Wants=apache2.service -After=apache2.service +Wants=apache2.service openqa-webui.service +After=apache2.service openqa-webui.service
commit 5d8bf4eaa Author: Ludwig Nussel <email@example.com> Date: Thu Jun 6 16:23:00 2013 +0200 depend on apache diff --git a/systemd/openqa-worker@.service b/systemd/openqa-worker@.service index fff1b0019..41be8a1dd 100644 --- a/systemd/openqa-worker@.service +++ b/systemd/openqa-worker@.service @@ -4,6 +4,8 @@ # replace '1' with the instance number you want [Unit] Description=openQA Worker #%i +Wants=apache2.service +After=apache2.service
for me again bad examples of git commit messages. We know what is done already from the code change but we do not know why. I guess the use case is for a single-instance setup to synchronise the services which IMHO makes sense. The automatic reconnect of the worker might obsolete at least the dependency on the webui.
The relation to "fetchneedles" I do not understand. Before changing this we should understand the requirements for both the single-instance as well as distributed setup. The "webui installed but local worker connected elsewhere" use case is a corner case we should try to cover as well but if we can not we would need to rely on the user to tinker with the local service definitions.
#4 Updated by nicksinger 8 months ago
apache2 is most likely really not relevant here because we don't even provide configs to reverse-proxy a worker through apache. However, starting the
openqa-webui in case it is installed and a worker is started is quite a sane default to me. I can understand that this default might not work for every user but this is part of the reason why distributions switched to systemd. It enables the user to easily customize and adjust services to their needs.
I see it similar to okurz that only starting the worker is not a default use-case. Therefore, ggardet_arm I'd currently suggest you to adjust the service files to your needs with an appropriate service override (e.g. use
systemctl edit openqa-worker). However I'm fully open for discussions if we should really keep
#6 Updated by ggardet_arm 8 months ago
Is there an option to tell: "Start after X, only if X is enabled. Otherwise, ignore." ?
Because ATM, I disable openqa-webui/openqa-gru services, but they start again at each boot due to openqa-worker service which is a bit annoying.
I will have a look at
systemctl edit openqa-worker if there is no better defaults.
Maybe it works to mask the
openqa-webuiservice. (Of course that's not a good solution if you want to start the service occasionally manually but just not by default.)
Is this the recommended solution then? Or are you still planning on proposing a change to the dependencies?
- Category set to Feature requests
- Status changed from In Progress to Feedback
- Assignee changed from mkittler to okurz
I am now convinced that we should remove both the
After=openqa-webui.service. The reason is that the systemd service definition does not know for which openQA webUI instance the worker is configured, if it is remote or local, so pulling in and waiting for the local webUI regardless of the configuration is incorrect. The prerequisite to be able to remove the dependency is that the worker automatically reconnects until it can connect to the configured webui. The argument about "the user can configure systemd anyway" still counts in any case: When we do not specify the dependency one can add it additionally in an override. And actually adding is always easier than overriding in a way that the original ones are not there anymore because then you need to replicate the parts you still want in :)