Run the supervisor program conditionally

Suppose I have two programs in a supervisor. Is there a way to run the first program (background process) conditionally without moving it to a separate script file?

[supervisord] nodaemon=true logfile=/tmp/supervisord.log #Need this program to run conditionally - say based off an environment variable being set [program:prog1] command=/bin/prog1 [program:prog2] command=/bin/prog2 -DFOREGROUND 
+5
source share
1 answer

Pass the conditional value SERVER1_START and control the flow.

 [program:somecommand] command=bash -c "if [ ${SERVER1_START} = "VALUE-X" ]; then /apps/bin/start.sh /apps/server.properties; fi" 
+1
source

Source: https://habr.com/ru/post/1246000/


All Articles