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.
[ Parent
| on HN ]
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.
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.
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.
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.
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.