This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch v3-1-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/v3-1-test by this push:
new 51ff37d83fd [v3-1-test] Fix systemd service files issues (#57126)
(#57231)
51ff37d83fd is described below
commit 51ff37d83fd9cb3662c3726bbef29d1575f3b0ab
Author: github-actions[bot]
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Sat Oct 25 18:53:48 2025 +0200
[v3-1-test] Fix systemd service files issues (#57126) (#57231)
This commit addresses multiple bugs in systemd service files reported
in issue #53706:
1. Fix incorrect command in airflow-api.service
- Changed 'airflow api' to 'airflow api-server' (correct CLI command)
2. Standardize environment configuration approach
- Changed airflow-api.service and airflow-triggerer.service to use
EnvironmentFile=/etc/sysconfig/airflow instead of inline Environment
- This provides consistency with other services and allows admins
flexibility to manage custom environment variables centrally
3. Fix service dependencies
- Added proper After= and Wants= clauses for database and message
queue services (postgresql, mysql, redis, rabbitmq) to
airflow-api.service and airflow-triggerer.service
- Services now wait for required dependencies before starting
4. Additional bug fixes discovered during review
- airflow-flower.service: Removed duplicate ExecStart line
- airflow-kerberos.service: Fixed command from 'kerberos' to
'airflow kerberos'
5. Consistency improvements
- Added Type=simple and RestartSec=5s to airflow-api.service and
airflow-triggerer.service for consistency with other services
All systemd service files now follow the same configuration pattern,
making them easier to maintain and more reliable during system startup.
Fixes #53706
(cherry picked from commit b37016084ed73318eaff1a871b42d9cc2e599b55)
Co-authored-by: Ashir Alam <[email protected]>
---
scripts/systemd/airflow-flower.service | 1 -
scripts/systemd/airflow-kerberos.service | 2 +-
scripts/systemd/airflow-triggerer.service | 9 ++++++---
3 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/scripts/systemd/airflow-flower.service
b/scripts/systemd/airflow-flower.service
index 4056dbf98a0..24ce59ed2e6 100644
--- a/scripts/systemd/airflow-flower.service
+++ b/scripts/systemd/airflow-flower.service
@@ -26,7 +26,6 @@ EnvironmentFile=/etc/sysconfig/airflow
User=airflow
Group=airflow
Type=simple
-ExecStart=/bin/airflow celery flower
ExecStart=/bin/bash -c 'source /home/airflow/airflow_venv/bin/activate &&
airflow celery flower'
Restart=on-failure
RestartSec=5s
diff --git a/scripts/systemd/airflow-kerberos.service
b/scripts/systemd/airflow-kerberos.service
index 549e3550536..ff9b447577a 100644
--- a/scripts/systemd/airflow-kerberos.service
+++ b/scripts/systemd/airflow-kerberos.service
@@ -26,7 +26,7 @@ EnvironmentFile=/etc/sysconfig/airflow
User=airflow
Group=airflow
Type=simple
-ExecStart=/bin/bash -c 'source /home/airflow/airflow_venv/bin/activate &&
kerberos'
+ExecStart=/bin/bash -c 'source /home/airflow/airflow_venv/bin/activate &&
airflow kerberos'
Restart=on-failure
RestartSec=5s
diff --git a/scripts/systemd/airflow-triggerer.service
b/scripts/systemd/airflow-triggerer.service
index f7345aa2bea..fa7dd87c0ba 100644
--- a/scripts/systemd/airflow-triggerer.service
+++ b/scripts/systemd/airflow-triggerer.service
@@ -18,14 +18,17 @@
[Unit]
Description=Airflow Triggerer
-After=network.target
+After=network.target postgresql.service mysql.service redis.service
rabbitmq-server.service
+Wants=postgresql.service mysql.service redis.service rabbitmq-server.service
[Service]
-Environment=AIRFLOW_HOME=/home/airflow/airflow_home
+EnvironmentFile=/etc/sysconfig/airflow
User=airflow
Group=airflow
-Restart=always
+Type=simple
ExecStart=/bin/bash -c 'source /home/airflow/airflow_venv/bin/activate &&
airflow triggerer'
+Restart=always
+RestartSec=5s
[Install]
WantedBy=multi-user.target