News for hackers. Stuff that matters.
Re:Systemd: The Biggest Fallacies by felixgallo on Friday September 26, 2014 @07:02PM (#8375348)
It's not shell scripts, it's /bin/bash -- the guy fieri of shells.
Re:Systemd: The Biggest Fallacies by astine on Friday September 26, 2014 @07:40PM (#8375457)
Which also happens to be the default or expected shell in the majority of sysv installs on Linux. '/bin/sh' symlinks to bash, shell scripts specify '/bin/sh' So it's another example of a distinction without a difference to single out bash. Most sysadmins cannot just switch to ZSH to to write their init scripts.
Re:Systemd: The Biggest Fallacies by bronson on Friday September 26, 2014 @07:47PM (#8375479)
Debian and its many derivatives (including Ubunutu) use Dash, and the BSDs tend to use some form of Ash. I don't have the statistics but, if it's true that a majority of distros still use Bash for noninteractive use, it's a tiny majority.
Re:Systemd: The Biggest Fallacies by astine on Friday September 26, 2014 @08:01PM (#8375526)
Well, a lot of them then... I know that Arch and Gentoo at least use Bash and I'd be surprised if they were the only ones.
Re:Systemd: The Biggest Fallacies by profsnuggles on Friday September 26, 2014 @09:23PM (#8375721)
Arch is using systemd and openrc comitted to using POSIX sh in their init scripts some time ago. So you can use dash or whatever posix compatible shell you want with it.
Re:Systemd: The Biggest Fallacies by vlad003 on Friday September 26, 2014 @07:51PM (#8375487)
On Ubuntu, since 6.10, Dash has been the default system shell rather than Bash. '/bin/sh' symlinks to '/bin/dash'.
Re:Systemd: The Biggest Fallacies by felixgallo on Friday September 26, 2014 @08:31PM (#8375603)
You've already been corrected with regard to the rest of your argument, but I'll correct you on the last part too: they could do so just fine. That's the power of a modular, non-tightly coupled system. Any script that uses ksh, zsh, bash, csh, tcl, lua, rc, whatever, runs fine under sysvinit.
Re:Systemd: The Biggest Fallacies by astine on Friday September 26, 2014 @08:46PM (#8375636)
No, my point is that you cannot just take a script written for bash and run it on Zsh or Ksh and expect it to just work. (Well, sometimes you can, but that's beside the point.) Yes you can write your init scripts in whatever language you want, even Lisp or Python, but you have to do that for every daemon you switch over. Imagine a lot of these Linux distros which often implement their own init scripts for each program they support having to switch shells. That's hundreds of scripts to rewrite, or at least proofread and test.
Re:Systemd: The Biggest Fallacies by digi_owl on Saturday September 27, 2014 @01:46AM (#8376190)
And nobody does that. They write for sh, that qll those others are compatible with.

This means you can swap one part and expect things to work, rather than having to swap the whole engine because you want to swap one part.

Re:Systemd: The Biggest Fallacies by andreasvc on Saturday September 27, 2014 @06:43AM (#8376660)
It's not just bash. Shell scripting in general is "stringly typed" and brittle because of that. Furthermore, when an error occurs and no special options have been set, the script will just continue as if nothing happened. This behavior does not encourage writing correct programs.