3 ms·
This whole thing is also loaded with TOCTOU problems. It's almost always best just to try to do what you want to do and check for failure.
by VWWHFSfQ 5y ago
This whole thing is also loaded with TOCTOU problems. It's almost always best just to try to do what you want to do and check for failure.
- zymhan 5y agoI had to look up TOCTOU https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use https://en.wikipedia.org/wiki/Time-of-check_to_time-of-use Very interesting!
- User23 5y agoThat link also describes the Catholic schoolboy algorithm: ask forgiveness not permission.
- pas 5y agoOrchestration/install/setup scripts are usually run while nothing else is running. Bash is not ideal for this. But it's not ideal for almost everything. Still making things idempotent-ish is better than bailing on every recoverable error and making the admin do the cleanup manually so the script can finally do what it supposed to do. (Of course a few years ago immutable infrastructure was the rage, because it means if the script runs once, pack it up as a VM and you're done. And that's how the docker sausage images are made.)