Trying to automate cert renewal but says there is a problem with httpd config


I have been able to create and renew certs from the command line without any problems but I am now wanting to move this to cron. To do this I am running this on the command line as a test before moving to cron:

sudo /home/ec2-user/letsencrypt/letsencrypt-auto --config /home/ec2-user/letsencrypt/cert.ini certonly --debug 
&& service httpd reload

Which gives me the following:

Updating letsencrypt and virtual environment dependencies......
Requesting root privileges to run with virtualenv: /root/.local/share/letsencrypt/bin/letsencrypt --config /home/ec2-user/letsencrypt/secure_textinconfidence_com.ini certonly --debug
Version: 1.1-20080819
Version: 1.1-20080819

 - Congratulations! Your certificate and chain have been saved at
   Your cert will expire on 2016-05-03. To obtain a new version of the
   certificate in the future, simply run Let's Encrypt again.
 - If you like Let's Encrypt, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:
   Donating to EFF:          

Reloading httpd: not reloading due to configuration syntax error

However when I run:

sudo service httpd configtest

I get:

Syntax OK

Is there something wrong with my command when combining with the cert renewal?


Answered my own question - service httpd reload needed sudo before it.