Certbot: error: unrecognized arguments: --deploy-hook


#1

Hello. Where is my mistake?

$ sudo certbot renew --deploy-hook ‘nginx -s reload’

usage:
  certbot [SUBCOMMAND] [options] [-d DOMAIN] [-d DOMAIN] ...

Certbot can obtain and install HTTPS/TLS/SSL certificates.  By default,
it will attempt to use a webserver both for obtaining and installing the
cert.
certbot: error: unrecognized arguments: --deploy-hook nginx -s reload

The same command with --post-hook works correctly:

$ sudo certbot renew --post-hook ‘nginx -s reload’

Saving debug log to /var/log/letsencrypt/letsencrypt.log

-------------------------------------------------------------------------------
Processing /etc/letsencrypt/renewal/mysite.com.conf
-------------------------------------------------------------------------------
Cert not yet due for renewal

The following certs are not due for renewal yet:
  /etc/letsencrypt/live/mysite.com/fullchain.pem (skipped)
No renewals were attempted.
No hooks were run.

#2

What version of Certbot are you using?

sudo certbot --version

--deploy-hook is a newer feature than --post-hook.

Edit: By the way, can you post the /etc/letsencrypt/renewal/ file?


Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. https://crt.sh/?q=example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is:

My web server is (include version):

The operating system my web server runs on is (include version):

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don’t know):

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):


#3

Hi @MaximYaskov

there you use ’ to mask the command. Same with --deploy-hook ?

sudo certbot renew --post-hook nginx -s reload


#4

Yes you are right. I am using certbot 0.10.2.
https://github.com/certbot/certbot/blob/master/CHANGELOG.md#0170—2017-08-02


#5

The good news is you can use --renew-hook. As the changelog says, it’s almost the same. :slightly_smiling_face:


closed #6

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.