mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-01-11 22:30:44 +01:00
mktemp on older OS's needs -t tmp #29
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @morganwdavis on GitHub (Jan 7, 2016).
If all references of $(mktemp) were changed to $(mktemp -t tmp) this would work universally, as some older OS's (FreeBSD 5.5 for example) will fail if no prefix option is provided:
but adding -t tmp will generate the same desired result:
@lukas2511 commented on GitHub (Jan 8, 2016):
Really? FreeBSD 5.5?... Isn't that completely unsupported since 2008?
I won't change this since the behaviour of
-t paramis different for BSD and GNUmktemp(on BSD it's a prefix, on GNU it's a template) and it would really over-complicate things to add a helper function just for supporting ancient systems.I suggest you write a simple wrapper and put it into
config.shwhich gets sourced byletsencrypt.sh, that should allow you to redefine how the realmktempis called.@morganwdavis commented on GitHub (Jan 8, 2016):
We've got one old FreeBSD machine that just keeps on running, needed for some legacy hosting applications. I wasn't sure at what point mktemp changed to support a no-option default, so I figured I'd report the simple work-around. Given the divergence between BSD and GNU, the wrapper is a great idea. Since config.sh is sourced, it would allow for a lot of localized "workarounds". Thanks for the suggestion.
Also, thank you for your work on letsencrypt.sh itself. It's a relief to not have to load up the FreeBSD letsencrypt client package as it has about 3 dozen Python dependencies that I'd have no other need for. Your shell script plus curl is a far more elegant, simple, lightweight solution. Nicely done!
@lukas2511 commented on GitHub (Jan 8, 2016):
Looks like this was changed around Oct 2012 (in
a0bfe4edc6), so probably was first released in FreeBSD 9.1 or 9.2.I think most people are using either 9.1+ or have already updated to FreeBSD 10, but if more people report this problem I may implement a workaround.
@lukas2511 commented on GitHub (Jan 9, 2016):
I now replaced all mktemp calls with
mktemp -t XXXXXX.This results in BSD tmpfiles to have a "XXXXXX" prefix, and GNU tmpfiles to have a random name with 6 characters.
A bit weird but whatever, it shouldn't cause any problems.
@morganwdavis commented on GitHub (Jan 9, 2016):
Works great! Thank you, Lukas!
@Rycochet commented on GitHub (Apr 22, 2016):
...and sadly this fails on QNAP -
@morganwdavis commented on GitHub (Apr 22, 2016):
Lukas, if you want to revert the -t option so QNAP works, I'm fine with that. We retired our old FreeBSD machine so this is no longer a concern. Your idea of the wrapper as a workaround is probably best for any legacy cases that arise.
@lukas2511 commented on GitHub (Apr 22, 2016):
@morganwdavis nope, this option will stay, qnap users will have to look for workarounds. sorry @Rycochet.
@Rycochet commented on GitHub (Apr 22, 2016):
I've had a quick look, and for some reason mktemp doesn't want to work properly on there anyway - so don't revert - this needs looking into more as something else seems funny - not a linux guy here, but I can try things out - mktemp output on QNAP -
@bittorf commented on GitHub (Apr 23, 2016):
@lukas2511 please note, that '-t' is deprecated, see http://www.gnu.org/software/autogen/mktemp.html - dont use it!
@lukas2511 commented on GitHub (Apr 23, 2016):
@bittorf i f****ng hate things like this. changed in
f096c62. this will probably break this script for a few people, but whatever.edit: thanks anyway.