diff --git a/deployment/templates/alts-celery.service.j2 b/deployment/templates/alts-celery.service.j2 index 7d3e53c..eac3a3e 100644 --- a/deployment/templates/alts-celery.service.j2 +++ b/deployment/templates/alts-celery.service.j2 @@ -8,13 +8,15 @@ Group={{ test_system_user }} WorkingDirectory=/home/{{ test_system_user }}/alts Environment=CELERY_CONFIG_PATH={{ test_system_config_dir }}/celery.yaml ExecStartPre=-/usr/bin/find /tmp -maxdepth 1 -type d -name {{ worker_type }}_test_runner* -exec rm -rf {} + -ExecStart={{ celery_venv_dir }}/bin/celery -A alts.worker.app worker \ +# Start through /bin/sh like alts-scheduler: under SELinux, systemd may not +# execute binaries labelled as user home content directly +ExecStart=/bin/sh -c 'exec {{ celery_venv_dir }}/bin/celery -A alts.worker.app worker \ --pool={{ celery_pool_type }} \ --concurrency={{ celery_concurrency }} \ -O fair \ -Q {{ celery_queues|join(",") }} \ --loglevel={{ celery_loglevel }} \ - --logfile {{ celery_log_file }} + --logfile {{ celery_log_file }}' [Install] WantedBy=multi-user.target