Add a qualifier for path to curl? #327

Closed
opened 2025-12-29 01:22:44 +01:00 by adam · 2 comments
Owner

Originally created by @thegushi on GitHub (Apr 11, 2018).

Hey there,

When I run this script under FreeBSD's /etc/crontab, the default path is:

PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin

Even though I'm calling Dehydrated via its full path, it fails to find curl. Adding an override within the script to set the environment, or to specify the full path to curl would be useful.

Thanks.

Originally created by @thegushi on GitHub (Apr 11, 2018). Hey there, When I run this script under FreeBSD's /etc/crontab, the default path is: PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin Even though I'm calling Dehydrated via its full path, it fails to find curl. Adding an override within the script to set the environment, or to specify the full path to curl would be useful. Thanks.
adam closed this issue 2025-12-29 01:22:45 +01:00
Author
Owner

@jobe1986 commented on GitHub (Apr 11, 2018):

In my own experience I have found it is best practice to be able to specify the full path to executables in scripts run via crontab to avoid issues with $PATH searching.

Also there is already an option to allow you to specify the OpenSSL binary (defaults to "openssl but could be set to a full path) so it makes sense there should be one for curl too.

@jobe1986 commented on GitHub (Apr 11, 2018): In my own experience I have found it is best practice to be able to specify the full path to executables in scripts run via crontab to avoid issues with $PATH searching. Also there is already an option to allow you to specify the OpenSSL binary (defaults to "openssl but could be set to a full path) so it makes sense there should be one for curl too.
Author
Owner

@lukas2511 commented on GitHub (Apr 12, 2018):

@jobe1986 and then add a variable for a path to the sed binary? and for awk and grep? mktemp and diff would also be great... really i don't think this is necessary or even a good idea, that's exactly what the PATH variable was designed to solve. "openssl" binary can be set mostly for compatibility with libressl (but wouldn't even really be necessary, I just won't revert it as it would break some existing setups).

@thegushi you have to make sure that your PATH variable is actually exported, otherwise dehydrated won't see or use it.

If for whatever reason you are having problems with this you could in theory override either "curl" in your config (something like curl() { /usr/bin/curl ${*}) or export a correct PATH variable in there (it's just a shell script that is sourced by dehydrated)

Also isn't curl normally installed under /usr/local/bin on FreeBSD? That isn't in your PATH, that may be your problem.

@lukas2511 commented on GitHub (Apr 12, 2018): @jobe1986 and then add a variable for a path to the sed binary? and for awk and grep? mktemp and diff would also be great... really i don't think this is necessary or even a good idea, that's exactly what the PATH variable was designed to solve. "openssl" binary can be set mostly for compatibility with libressl (but wouldn't even really be necessary, I just won't revert it as it would break some existing setups). @thegushi you have to make sure that your PATH variable is actually exported, otherwise dehydrated won't see or use it. If for whatever reason you are having problems with this you could in theory override either "curl" in your config (something like `curl() { /usr/bin/curl ${*}`) or export a correct PATH variable in there (it's just a shell script that is sourced by dehydrated) Also isn't curl normally installed under /usr/local/bin on FreeBSD? That isn't in your PATH, that may be your problem.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/dehydrated#327