From 7307ba28e2e5ca0b92a552303e0043e94f974bc6 Mon Sep 17 00:00:00 2001 From: Dmitry Tantsur Date: Wed, 26 Jan 2022 14:20:13 +0100 Subject: [PATCH] Use Type=notify in systemd units for services This way systemd will wait for services to start and can report failures directly to Ansible (or an operator). Notifications are provided by oslo.service or gunicorn. Depends-On: https://review.opendev.org/c/openstack/ironic/+/826470 Change-Id: I6970c2f844075f6ccd15a4656f12bd063aebda6c --- .../templates/redfish-emulator.service.j2 | 2 +- .../templates/ironic-prometheus-exporter.service.j2 | 2 +- .../roles/bifrost-ironic-install/templates/systemd_template.j2 | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/playbooks/roles/bifrost-create-vm-nodes/templates/redfish-emulator.service.j2 b/playbooks/roles/bifrost-create-vm-nodes/templates/redfish-emulator.service.j2 index a8222e291..33e032e32 100644 --- a/playbooks/roles/bifrost-create-vm-nodes/templates/redfish-emulator.service.j2 +++ b/playbooks/roles/bifrost-create-vm-nodes/templates/redfish-emulator.service.j2 @@ -2,7 +2,7 @@ Description=Sushy Redfish Emulator [Service] -Type=simple +Type=notify Restart=on-failure ExecStart={{ bifrost_venv_dir }}/bin/gunicorn sushy_tools.emulator.main:app \ --bind {{ redfish_emulator_host }}:{{ redfish_emulator_port }} \ diff --git a/playbooks/roles/bifrost-ironic-install/templates/ironic-prometheus-exporter.service.j2 b/playbooks/roles/bifrost-ironic-install/templates/ironic-prometheus-exporter.service.j2 index 7393a042a..39898c1a2 100644 --- a/playbooks/roles/bifrost-ironic-install/templates/ironic-prometheus-exporter.service.j2 +++ b/playbooks/roles/bifrost-ironic-install/templates/ironic-prometheus-exporter.service.j2 @@ -2,7 +2,7 @@ Description=Ironic Prometheus Exporter Flask App [Service] -Type=simple +Type=notify Restart=on-failure ExecStart={{ bifrost_venv_dir }}/bin/gunicorn ironic_prometheus_exporter.app.wsgi:application \ --bind {{ prometheus_exporter_host }}:{{ prometheus_exporter_port}} \ diff --git a/playbooks/roles/bifrost-ironic-install/templates/systemd_template.j2 b/playbooks/roles/bifrost-ironic-install/templates/systemd_template.j2 index 0aa9ab1fd..04578d5e3 100644 --- a/playbooks/roles/bifrost-ironic-install/templates/systemd_template.j2 +++ b/playbooks/roles/bifrost-ironic-install/templates/systemd_template.j2 @@ -2,6 +2,7 @@ Description={{ service_name }} service [Service] +Type=notify ExecStart={{ service_path }}/{{ service_name }} --config-file {{ config_file }} User=ironic