3 ms·
> only dependencies are curl and bash This isn’t really true, from an strace it also execs cat, wc, date, echo, mkdir, mktemp, and rmdir.
by cle 6y ago
> only dependencies are curl and bash
This isn’t really true, from an strace it also execs cat, wc, date, echo, mkdir, mktemp, and rmdir.
- deleted 6y ago[deleted]
- jandeboevrie 6y agoThose you might expect on a modern Linux system when bash is there (coreutils will be there 99% of the time as well). Not all distros ship curl by default
- cle 6y agoBash runs on a lot more than Linux. I ran a Docker container and copied a statically-linked curl and bash onto a scratch image and ran it, it does not work: $ docker run -it --rm $(docker build -q .) /srvmon.sh: line 162: date: command not found $ cat Dockerfile FROM scratch COPY bash /usr/bin/bash COPY curl /usr/bin/curl COPY srvmon.sh /srvmon.sh CMD ["/usr/bin/bash", "/srvmon.sh"] I'm not pointing this out to be pedantic. I'm pointing it out because there is a common misconception that all these things like "date" and "cat" and "mkdir" are part of Bash, but they're not, they're part of coreutils and there are dramatically different versions of coreutils on different installations of Linux, macOS, BSD, etc., and some environments (like barebones Docker containers) don't have coreutils at all.
- superkuh 6y agoPeople who use containers where they aren't required or even sensible deserve, and should expect, what they intentionally get. Yours is not an argument showing that coreutils aren't everywhere. They are. It only shows that you specifically went out of your way to create an obscure environment designed explicitly to not have what it needed.
- jandeboevrie 6y agoAgree with superkuh in this point. If you only have a hammer every problem looks like a nail. But I've updated the Readme with coreutils as a dependency.
- cle 6y agoMy argument isn’t about containers, I was using that as an easy way to illustrate my point. I care about this because I deal with it all the time. Coreutils programs have pretty different behavior across distributions and OSs, we shouldn’t sweep implicit dependencies under the rug.