I have a rerun
command that looks like this:
CFG="cfg/nginx/my-app.conf" rerun -p "$CFG" -- \ nginx -p . -c "$CFG" -t && \ nginx -p . -c "$CFG"
The idea is that every time the nginx config changes the nginx server should be shut down, the config should be tested using the -t
flag, and if successful, the server should re-launch.
The issue here is that rerun uses the PID of the test command to try to restart nginx, which means nginx doesn't get shut down. The end result is that it complains about the port being busy when it attempts to start the server again.
Is rerun
just unable to handle a scenario like this, or can it be made to work? Are there any alternatives that would get the job done?