I am using supervisord inside a Docker container to manage my running processes and would like to also use it to trigger certain commands - run them once and expect them to exit with 0.

Here's one example:

command = /usr/bin/php /var/www/app/artisan post
autostart = false
autorestart = false
startsecs = 3
startretries = 0
exitcodes = 0

And I'm using nsenter's docker-enter with supervisorctl start central-seed-posts to trigger it but I would also like to handle a successful exit instead of supervisor telling me ERROR (abnormal termination)

Does it have to do with supervisor events ?


Problem you are encountering seems to be with the following option you use:

startsecs = 3

If you read manual of supervisord, you can see that startsecs sets for how long the process has to stay alive after a startup for Supervisord to consider the start successful. Your process is probably exiting before 3 secs, which suggests to supervisord that startup was not successful.

Try lowering that to 0, unless you have a real reason to keep it 3 sec.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.