I’m trying to run two commands in a single line, which will validate the syntax of apache configuration copied from template file and send a signal to reload the apache if it’s passed.
Right now, my configuration looks like as below where I only sending the signal to apache to reload after coping the config from template file and it’s working fine.
First i would make this a script and use the 'script' module, but the
issue you are probably hitting is that 'command' does not support
'shellisms' like &&, so you need to use the shell module
Like, if I run this command - docker exec -it apache bash -c “/usr/local/apache2/bin/httpd -t && echo a” ,then it execute properly.
But, once I’m trying to run this - docker exec -it apache bash -c “/usr/local/apache2/bin/httpd -t && /bin/kill -s USR1 apache” ,then 1st command is getting executed but 2nd command is giving error as I used ‘docker exec’ to get into the container and it can’t reload the apache staying inside of container.