Skip to content

Start Celery worker through /bin/sh like Flower and scheduler - #232

Merged
anfimovdm merged 1 commit into
masterfrom
al-celery-service-selinux
Oct 23, 2026
Merged

anfimovdm merged 1 commit into
masterfrom
al-celery-service-selinux

Conversation

@anfimovdm

Copy link
Copy Markdown
Contributor

Summary

alts-celery fails to start on the s390x node (SELinux enforcing):

alts-celery.service: Failed to locate executable /home/test-system/.venv-celery/bin/celery: Permission denied
alts-celery.service: Main process exited, code=exited, status=203/EXEC

This is the same failure fixed for Flower in efb35a3: systemd won't execute a binary from a venv in the user's home directory directly under SELinux. alts-scheduler and alts-flower already start through /bin/sh -c 'exec ...'; alts-celery was the remaining unit that didn't. It likely surfaced now because the update tag (85bbd04) re-runs the pip install, which rewrites bin/celery with the default home-directory label (not confirmed on the host).

Changes

  • deployment/templates/alts-celery.service.j2: wrap ExecStart in /bin/sh -c 'exec ...'. With exec, celery replaces the shell and stays the unit's main process. ExecStartPre is unchanged.

Testing

  • Rendered the template with the s390x node's values (docker-s390x-0 queue, /home/test-system/.venv-celery) and ran systemd-analyze verify on it: no errors.
  • Not yet verified on the host. After merge, re-run celery_playbook.yml with --tags update on the s390x node and check systemctl status alts-celery.

🤖 Generated with Claude Code

On SELinux-enforcing hosts systemd refused to execute the celery binary from the venv in the user's home directory ('Failed to locate executable ... Permission denied', status 203/EXEC), which broke alts-celery on the s390x node. Start it via /bin/sh -c 'exec ...', the same way alts-flower and alts-scheduler start their home venv binaries, so no SELinux relabelling is needed.
@anfimovdm
anfimovdm merged commit e30b989 into master Oct 23, 2026
1 of 3 checks passed
@anfimovdm
anfimovdm deleted the al-celery-service-selinux branch October 23, 2026 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant