Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set ownership of Gravity state dir to galaxy_user:galaxy_group when created by SupervisorProcessManager #104

Closed
wants to merge 1 commit into from

Conversation

kysrpex
Copy link
Contributor

@kysrpex kysrpex commented Apr 12, 2023

SupervisorProcessManager invokes os.makedirs(self.supervisord_conf_dir), where self.supervisord_conf_dir = os.path.join(self.supervisor_state_dir, "supervisord.conf.d") and self.supervisor_state_dir = os.path.join(state_dir, "supervisor") and state_dir is the Gravity state directory. If state_dir does not exist beforehand and galaxyctl is invoked as root, then state_dir is created and owned by root, breaking Celery, as it needs to create the file celery-beat-schedule in state_dir, but runs as galaxy_user.

This the cause of issue #187 in the ansible-galaxy repo and this PR attempts to fix it.

… created by `SupervisorProcessManager`

SupervisorProcessManager invokes `os.makedirs(self.supervisord_conf_dir)`, where `self.supervisord_conf_dir = os.path.join(self.supervisor_state_dir, "supervisord.conf.d")` and `self.supervisor_state_dir = os.path.join(state_dir, "supervisor")` and `state_dir` is the Gravity state directory. If `state_dir` does not exist beforehand and `galaxyctl` is invoked as root, then `state_dir` is created and owned by root, breaking Celery, as it needs to create the file celery-beat-schedule in `state_dir`, but runs as `galaxy_user`.

This commit attempts to fix the issue.
@natefoo
Copy link
Member

natefoo commented Apr 13, 2023

I think #105 should accomplish this a bit cleaner.

@kysrpex
Copy link
Contributor Author

kysrpex commented Apr 13, 2023

Completely agree, closing this one.

@kysrpex kysrpex closed this Apr 13, 2023
@kysrpex kysrpex deleted the state_dir branch April 13, 2023 08:25
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.

2 participants