I have a few HAProxy installs and some scripts to automate stuff.
When I restart HAProxy manually, everything is ok:
root@hapxtest:~# systemctl restart haproxy root@hapxtest:~# echo $? 0
However, when I execute the same command from either bash, I get return code 2:
haproxy -c -V -f $HAPROXYCONFIG if [ $? -eq 0 ]; then echo Reloading HAProxy systemctl restart haproxy # TODO: For some reason we always get rc 2 # if [ $? -eq 0 ]; then # echo SOS: Something went wrong while reloading HAProxy # exit 2 # fi
I really cannot figure out why. Any idea?