letsencrypt renew: Port 80 is already in use Topic is solved

Having issues with your DietPi installation, or, found a bug? Post it here.
lanznaster
Posts: 16
Joined: Thu Sep 05, 2019 10:26 am

Re: letsencrypt renew: Port 80 is already in use

Post by lanznaster »

I use the dietpi-letsencrypt command and changed the key size, but it didnt renewed since it was already done.

But now it is working, I've already tried the dietpi-letsencrypt before without changing the settings.

Well, it is good now, thanks for the support :D
User avatar
Joulinar
Posts: 2068
Joined: Sat Nov 16, 2019 12:49 am

Re: letsencrypt renew: Port 80 is already in use

Post by Joulinar »

Ok do you know what you did to get it working again. Curious to see what it fixed. Usually if you use DietPi tools for refreshing the cert, it should place a service that will go to refresh your cert automatically.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
lanznaster
Posts: 16
Joined: Thu Sep 05, 2019 10:26 am

Re: letsencrypt renew: Port 80 is already in use

Post by lanznaster »

The only difference from my first try was changing the key value.
By the looks of it, next time that I need to renew it, this will happen. I'll make sure to document all my actions and update this post.

See you later and thanks again ;)
User avatar
Joulinar
Posts: 2068
Joined: Sat Nov 16, 2019 12:49 am

Re: letsencrypt renew: Port 80 is already in use

Post by Joulinar »

usually a manual refresh should not be needed because certbot will place a service to check twice a day if a refresh is needed.

Code: Select all

root@DietPi3:~# systemctl status certbot.timer
● certbot.timer - Run certbot twice daily
   Loaded: loaded (/lib/systemd/system/certbot.timer; enabled; vendor preset: enabled)
   Active: active (waiting) since Sun 2020-04-19 23:58:21 CEST; 21min ago
  Trigger: Mon 2020-04-20 15:24:44 CEST; 15h left

Apr 19 23:58:21 DietPi3 systemd[1]: Started Run certbot twice daily.
root@DietPi3:~#
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
lanznaster
Posts: 16
Joined: Thu Sep 05, 2019 10:26 am

Re: letsencrypt renew: Port 80 is already in use

Post by lanznaster »

I notice I do not have the trigger statement, is that ok?
cerbot.PNG
User avatar
Joulinar
Posts: 2068
Joined: Sat Nov 16, 2019 12:49 am

Re: letsencrypt renew: Port 80 is already in use

Post by Joulinar »

looks like it's missing. can you have am check how the service looks like

Code: Select all

systemctl cat certbot.timer
as well you could do a restart of the service and check it again

Code: Select all

systemctl restart certbot.timer
systemctl status certbot.timer
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
lanznaster
Posts: 16
Joined: Thu Sep 05, 2019 10:26 am

Re: letsencrypt renew: Port 80 is already in use

Post by lanznaster »

Code: Select all

root@DietPi:~# systemctl cat certbot.timer
# /lib/systemd/system/certbot.timer
[Unit]
Description=Run certbot twice daily

[Timer]
OnCalendar=*-*-* 00,12:00:00
RandomizedDelaySec=3600
Persistent=true

[Install]
WantedBy=timers.target
After the restart, similar status with no trigger:

Code: Select all

root@DietPi:~# systemctl restart certbot.timer
root@DietPi:~# systemctl status certbot.timer
● certbot.timer - Run certbot twice daily
   Loaded: loaded (/lib/systemd/system/certbot.timer; enabled; vendor preset: enabled)
   Active: active (waiting) since Tue 2020-04-21 11:17:00 BST; 6s ago

Apr 21 11:17:00 DietPi systemd[1]: Stopping Run certbot twice daily.
Apr 21 11:17:00 DietPi systemd[1]: certbot.timer: Adding 28min 1.794925s random time.
Apr 21 11:17:00 DietPi systemd[1]: Started Run certbot twice daily.
User avatar
Joulinar
Posts: 2068
Joined: Sat Nov 16, 2019 12:49 am

Re: letsencrypt renew: Port 80 is already in use

Post by Joulinar »

what I still found strange is that certbot is adding a randim timer. Not sure where this is coming from

Code: Select all

certbot.timer: Adding 28min 1.794925s random time.
pls can you check all systemctl timers

Code: Select all

systemctl list-timers --all
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
lanznaster
Posts: 16
Joined: Thu Sep 05, 2019 10:26 am

Re: letsencrypt renew: Port 80 is already in use

Post by lanznaster »

Here it is:

Code: Select all

root@DietPi:~# systemctl list-timers --all
NEXT                         LEFT          LAST                         PASSED       UNIT                         ACTIVATES
Wed 2020-04-22 11:09:00 BST  28min left    Wed 2020-04-22 10:39:08 BST  1min 19s ago phpsessionclean.timer        phpsessionclean.service
Wed 2020-04-22 12:34:27 BST  1h 54min left Wed 2020-04-22 00:28:07 BST  10h ago      certbot.timer                certbot.service
Wed 2020-04-22 21:17:43 BST  10h left      Tue 2020-04-21 21:18:26 BST  13h ago      systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service
n/a                          n/a           n/a                          n/a          apt-daily-upgrade.timer
n/a                          n/a           n/a                          n/a          apt-daily.timer

5 timers listed.
User avatar
Joulinar
Posts: 2068
Joined: Sat Nov 16, 2019 12:49 am

Re: letsencrypt renew: Port 80 is already in use

Post by Joulinar »

hmm the certbot timer is there ans seems active. As well it seems running every 12h, which is correct. Maybe we need to wait until your cert will be expire to see if it will be refreshed automatically

Code: Select all

NEXT                         LEFT          LAST                         PASSED       UNIT                         ACTIVATES
Wed 2020-04-22 12:34:27 BST  1h 54min left Wed 2020-04-22 00:28:07 BST  10h ago      certbot.timer                certbot.service
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
Post Reply