-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
The current handler implementation fails "sometimes" because Ansible will not call:
service supervisor restartbut will call something like this instead:
service supervisor stop && service supervisor startThis will fail "sometimes" because supervisor programs (and supervisor itself) are not completely stopped when service supervisor stop returns. Then, when service supervisor start is called immediately, it will fail.
See this post: https://stackoverflow.com/questions/32738415/supervisor-fails-to-restart-half-of-the-time
It can be fixed by rewriting the restart handler this way:
- name: stop supervisor
service:
name: supervisor
state: stopped
listen: "restart supervisor"
- name: waiting for supervisor to be stopped
wait_for:
path: /var/run/supervisord.pid
state: absent
sleep: 5
listen: "restart supervisor"
- shell: ps faux | grep supervisor
- name: start supervisor
service:
name: supervisor
state: started
listen: "restart supervisor"Edit: the proposal above does not work as expected yet. I'll edit it when I can confirm it works.
Another solution might be to call service supervisor restart using the Ansible shell module.
Metadata
Metadata
Assignees
Labels
No labels