Re: Running "certbot" ffom cron

From: Jerry <jerry_at_seibercom.net>
Date: Sun, 16 Feb 2025 16:42:43 UTC
On Wed, 12 Feb 2025 01:22:39 -0500, Karl Vogel stated:
>>> On Tue 11 Feb 2025 at 20:18:49 (-0500),
>>> fatty.merchandise677@aceecat.org wrote:  
>
>> On Tue, Feb 11, 2025 at 04:24:05PM -0500, Jerry wrote:  
>> > I have added this to the environment:
>> > CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1. I also put it at the top of my
>> > cron file.  
>> 
>> I am not sure if the FreeBSD cron supports setting environment like
>> this, although I have until now believed it does.  
>
>  You can set environment variables with 'NAME=value' syntax in
> FreeBSD; it's worked as far back as FreeBSD 6.4 or so.
>
>  I generally set a longer PATH in my crontab files, and I set CRON so
>  scripts know when they're not being run interactively:
>
>    CRON=yes
>    PATH=/usr/bin:/bin:/usr/sbin:/usr/local/sbin:/usr/local/libexec
>
>  I run this in a crontab file when installing a new system:
>
>    * * * * * /bin/env > /tmp/env$$
>
>  Results for my userid:
>
>    CRON=yes
>    HOME=/home/vogelke
>    LOGNAME=vogelke
>    PATH=/usr/bin:/bin:/usr/sbin:/usr/local/sbin:/usr/local/libexec
>    PWD=/home/vogelke
>    SHELL=/bin/sh
>    USER=vogelke
>
>  Running "tty" under cron gives me "not a tty" written to stderr and a
>  return code of 1.

Problem solved. Apparently, I had to add
CRYPTOGRAPHY_OPENSSL_NO_LEGACY=1 to the
/usr/local/etc/periodic/weekly/500.certbot-3.11 file. Now it works as
intended.