I have a bash script which loops forever and inside it checks an environment variable to see if it should run php yii process-queue or not. This script is the command for a docker container by the way and so is PID 1.
Output from ps aux:
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 19720 3340 ? Ss 09:26 0:00 /bin/bash /var/www/hub/process-queue-runner.sh
root 293 0.0 0.0 19936 3664 ? Ss 09:28 0:00 /bin/bash
root 1927 0.0 0.0 6012 648 ? S 09:42 0:00 sleep 0.5
root 1928 0.0 0.0 36092 3164 ? R+ 09:42 0:00 ps aux
When I run export RUNPROCQ=true from the command line I expected the loop to start running php yii process-queue but it doesn't - is there a command I can run in my bash script so it can see the RUNPROCQ environment variable value change?
My bash script called process-queue-runner.sh:
#!/bin/bash
while :
do
if [[ ${RUNPROCQ} != "false" ]]; then
php yii process-queue
fi
sleep 0.5
done
Here is the relevant section from the docker-compose.yml file:
procq:
image: hub_ui:latest
environment:
ENV: qa1
RUNPROCQ: "false" # this is to stop the proc q from running straight away - the refresh_db.sh script will set this to true once it has finished loading the fixtures
links:
- db:local.database.hub
- cache:local.cache.hub
command: /var/www/hub/process-queue-runner.sh
root 1 0.0 0.0 19720 3272 ? Ss 10:12 0:00 /bin/bash -c source /var/www/hub/process-queue-runner.shBut changing the env variable value still doesn't do anything...