# Help wanted for automatic-renewal

**URL:** <https://community.letsencrypt.org/t/help-wanted-for-automatic-renewal/125850>\
**Category:** Help\
**Created:** [June 15, 2020, 11:31am UTC](https://community.letsencrypt.org/t/help-wanted-for-automatic-renewal/125850 "2020-06-15T11:31:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![gulshankumar](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/gulshankumar/32/22923_2.png) [@gulshankumar](https://community.letsencrypt.org/u/gulshankumar)\
**Post date:** [June 15, 2020, 11:31am UTC](https://community.letsencrypt.org/t/help-wanted-for-automatic-renewal/125850/1 "2020-06-15T11:31:34Z")

</div>

I prefer using Cloudflare DNS plugin to generate wildcard SSL cert at NGINX server.

I had cron rule

```auto
14 5 * * * /usr/bin/certbot renew --quiet --post-hook "/usr/sbin/service nginx reload" > /dev/null 2>&1

```

After few month or days, I see …

 ![image](https://global.discourse-cdn.com/letsencrypt/original/3X/5/9/59ca469034167c9e639cbaf31731a8674c34d1a2.png)

I can solve by typing reboot when this occur but is there anyway I can prevent from keep happening?

Thanks

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [June 15, 2020, 7:01pm UTC](https://community.letsencrypt.org/t/help-wanted-for-automatic-renewal/125850/2 "2020-06-15T19:01:15Z")

</div>

> [@gulshankumar](#):
>
> `/usr/sbin/service nginx reload`

Does that command work?

> [@gulshankumar](#):
>
> is there anyway I can prevent from keep happening

Not sure if you mean  
A: to stop the problem from happening ("FIX")  
B: or looking for a way to overcome it ("WORKAROUND")

If A, then you need to find a command that works to reload NGINX when a cert is renewed or find the reason it is failing; start by removing the `--quiet`.  
If B, then you have many options... You could introduce an additional cron job that can reload/restart NGINX at any interval less than the time between the latest renewal and the expiration of the currently in use cert.

---

<div class="post-metadata">

**Author:** ![gulshankumar](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/gulshankumar/32/22923_2.png) [@gulshankumar](https://community.letsencrypt.org/u/gulshankumar)\
**Post date:** [June 16, 2020, 9:58am UTC](https://community.letsencrypt.org/t/help-wanted-for-automatic-renewal/125850/3 "2020-06-16T09:58:56Z")

</div>

Hi,

Let me rephrase my original query.

- I am using Ubuntu 18.04x64
- I obtain Let’s Encrypt SSL via Cloudflare DNS plugin
- Internally, it seems SSL certificate renew automatically
- I see NET::ERR\_CERT\_DATE\_INVALID
- When I reload nginx or reboot, then I see different issue and expiry date of cert in the web browser compared to earlier cert.

My question is

- Does certbot automatically renew and reload NGINX config as well?

If yes, maybe I can smoothly use Let’s Encrypt SSL without issues.

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [June 16, 2020, 7:24pm UTC](https://community.letsencrypt.org/t/help-wanted-for-automatic-renewal/125850/4 "2020-06-16T19:24:00Z")

</div>

> [@gulshankumar](#):
>
> Does certbot automatically renew and reload NGINX config as well?

It renews by default.  
It does not reload the web service by default.  
But your cron job shows the inclusion of:

> [@gulshankumar](#):
>
> `--post-hook "/usr/sbin/service nginx reload"`

which is how certbot would try to reload nginx when a cert was renewed.

So we need to understand why that call fails.  
For that, please show the output of:  
`sudo /usr/sbin/service nginx reload`  
Or if there are any other errors preventing that call from even being executed.  
For that, we can remove the `--quiet` from the cron job and review the logs after it runs (without it).

---

<div class="post-metadata">

**Author:** ![gulshankumar](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/gulshankumar/32/22923_2.png) [@gulshankumar](https://community.letsencrypt.org/u/gulshankumar)\
**Post date:** [June 18, 2020, 7:43pm UTC](https://community.letsencrypt.org/t/help-wanted-for-automatic-renewal/125850/5 "2020-06-18T19:43:10Z")

</div>

> [@rg305](#):
>
> It renews by default.  
> It does not reload the web service by default.

If it renew automatically that's great.  
Then, can I keep below rule to reload NGINX config everyday?

```nohighlight
0 0 * * * /etc/init.d/nginx reload >/dev/null 2>&1

```

My assumption is that

1. certbot will renew
2. and reload nginx config everyday to ensure latest cert reflect quickly as possible

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [June 18, 2020, 7:53pm UTC](https://community.letsencrypt.org/t/help-wanted-for-automatic-renewal/125850/6 "2020-06-18T19:53:57Z")

</div>

> [@gulshankumar](#):
>
> Then, can I keep below rule to reload NGINX config everyday?

If it works, yes.  
[test it first]

---

<div class="post-metadata">

**Author:** ![gulshankumar](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/gulshankumar/32/22923_2.png) [@gulshankumar](https://community.letsencrypt.org/u/gulshankumar)\
**Post date:** [June 18, 2020, 8:04pm UTC](https://community.letsencrypt.org/t/help-wanted-for-automatic-renewal/125850/7 "2020-06-18T20:04:39Z")

</div>

Yes, I tested with short period of time, it worked for me at Ubuntu 20.04 x64. Thanks for your support.

---

<div class="post-metadata">

**Author:** ![cptcharis](https://avatars.discourse-cdn.com/v4/letter/c/7993a0/32.png) [@cptcharis](https://community.letsencrypt.org/u/cptcharis)\
**Post date:** [June 18, 2020, 9:07pm UTC](https://community.letsencrypt.org/t/help-wanted-for-automatic-renewal/125850/8 "2020-06-18T21:07:01Z")

</div>

![image](https://global.discourse-cdn.com/letsencrypt/original/3X/b/c/bc6c4679bf0292e49397b41ec01e5d4ea80f1d3f.jpeg)

---

<div class="post-metadata">

**Author:** ![rg305](https://sea3.discourse-cdn.com/letsencrypt/user_avatar/community.letsencrypt.org/rg305/32/91314_2.png) [@rg305](https://community.letsencrypt.org/u/rg305)\
**Post date:** [June 18, 2020, 9:10pm UTC](https://community.letsencrypt.org/t/help-wanted-for-automatic-renewal/125850/9 "2020-06-18T21:10:52Z")

</div>

That means you can change:

> [@gulshankumar](#):
>
> ```nohighlight
> 14 5 * * * /usr/bin/certbot renew --quiet --post-hook "/usr/sbin/service nginx reload" > /dev/null 2>&1
> 
> ```

to just:

```nohighlight
14 5 * * * /usr/bin/certbot renew --quiet > /dev/null 2>&1

```

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/letsencrypt/original/3X/c/a/ca6c06ea1ea201324bba7048c6841ce60236468d.png) [@system](https://community.letsencrypt.org/u/system)\
**Post date:** [July 18, 2020, 9:10pm UTC](https://community.letsencrypt.org/t/help-wanted-for-automatic-renewal/125850/10 "2020-07-18T21:10:55Z")

</div>

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