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

netbox.service fails: uwsgi not in PATH of user netbox on CentOS8 #120

Closed
azrdev opened this issue Dec 15, 2020 · 1 comment
Closed

netbox.service fails: uwsgi not in PATH of user netbox on CentOS8 #120

azrdev opened this issue Dec 15, 2020 · 1 comment

Comments

@azrdev
Copy link
Contributor

azrdev commented Dec 15, 2020

I'm running the examples/playbook_single_host_deploy.yml against a CentOS 8 host. It fails when starting the systemd services:

TASK [lae.netbox : Start and enable NetBox' socket and service] ******************************************************
changed: [sl8.example.com] => (item=netbox.socket)
failed: [sl8.example.com] (item=netbox.service) => {"ansible_loop_var": "item", "changed": false, "item": "netbox.service", "msg": "Unable to start service netbox.service: Job for netbox.service failed because the control process exited with error code.\nSee \"systemctl status netbox.service\" and \"journalctl -xe\" for details.\n"}

journalctl -e has only this information:

Dec 15 15:27:13 sl8 env[29752]: /usr/bin/env: ‘uwsgi’: Permission denied

Apparently the PATH is not set for the netbox user configured in the systemd unit:

# sudo -u netbox -g netbox -i   /usr/bin/printenv  PATH
/srv/netbox/.local/bin:/srv/netbox/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/bin
# printenv PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/usr/bin
# which uwsgi
/usr/local/bin/uwsgi

26a4226 seems to have been intended to fix this issue, but did not cover the systemd unit.

@azrdev
Copy link
Contributor Author

azrdev commented Dec 16, 2020

Apparently not PATH is the problem, but /usr/local/bin/uwsgi having 700 permissions and therefore only readable by root, not the netbox user.
Adding umask: "0022" to the pip: module call in tasks/main.yml fixes that problem.

@lae lae closed this as completed in b99fd74 Mar 24, 2021
lae added a commit that referenced this issue Mar 24, 2021
fix #120: ensure user netbox can read+exe /usr/local/bin/uwsgi
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

No branches or pull requests

1 participant