From db3df8f74718bf77e28fd83e3efffe2828ecddd0 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Mon, 28 Mar 2022 10:39:38 +0200 Subject: [PATCH] copr-fe: consume the messages as non-root user And consolidate the two service drop-in config files. Fixes: https://pagure.io/copr/copr/issue/2036 --- .../fm-consumer@copr_messaging.service.d/50-copr.conf | 9 +++++++++ .../fm-consumer@copr_messaging.service.d/50-restart.conf | 4 ---- roles/copr/frontend/tasks/main.yml | 1 - 3 files changed, 9 insertions(+), 5 deletions(-) delete mode 100644 roles/copr/frontend/files/systemd/system/fm-consumer@copr_messaging.service.d/50-restart.conf diff --git a/roles/copr/frontend/files/systemd/system/fm-consumer@copr_messaging.service.d/50-copr.conf b/roles/copr/frontend/files/systemd/system/fm-consumer@copr_messaging.service.d/50-copr.conf index 28bff1573e..a67f21ed25 100644 --- a/roles/copr/frontend/files/systemd/system/fm-consumer@copr_messaging.service.d/50-copr.conf +++ b/roles/copr/frontend/files/systemd/system/fm-consumer@copr_messaging.service.d/50-copr.conf @@ -1,2 +1,11 @@ [Service] +# We still need to move Frontend code to default system paths. Environment=PYTHONPATH=/usr/share/copr/coprs_frontend + +# When the service is killed or failed, start it again +Restart = on-failure +RestartSec = 5s + +# The default fedora messaging service file runs under root +User=copr-fe +Group=copr-fe diff --git a/roles/copr/frontend/files/systemd/system/fm-consumer@copr_messaging.service.d/50-restart.conf b/roles/copr/frontend/files/systemd/system/fm-consumer@copr_messaging.service.d/50-restart.conf deleted file mode 100644 index e98b03b3ea..0000000000 --- a/roles/copr/frontend/files/systemd/system/fm-consumer@copr_messaging.service.d/50-restart.conf +++ /dev/null @@ -1,4 +0,0 @@ -# When the service is killed or failed, start it again -[Service] -Restart = on-failure -RestartSec = 5s diff --git a/roles/copr/frontend/tasks/main.yml b/roles/copr/frontend/tasks/main.yml index 42b20bcbdd..384c4318bf 100644 --- a/roles/copr/frontend/tasks/main.yml +++ b/roles/copr/frontend/tasks/main.yml @@ -176,7 +176,6 @@ - name: start fm-consumer service service: state=started enabled=yes name="fm-consumer@copr_messaging" when: - - ansible_facts.packages['copr-frontend'][0].version is version('1.156', '>=') - not services_disabled|bool - name: install bash_profile file to ease some admin tasks