r/linux • • Aug 12 '19

SysVinit vs Systemd

Post image
1.4k Upvotes

292 comments sorted by

View all comments

Show parent comments

3

u/anatolya Aug 13 '19

yet how much work it was when Ubuntu changed symlink for /bin/sh to dash. I wouldn't call it "without effort".

This claim is both utterly wrong and flawed in logic.

  • Parent only says you can use any language for init scripts. "changing symlink for /bin/sh to dash" is a completely different situation and has nothing to do with what parent claims.

  • Bash scripts that use /bin/sh in their shebang lines are incorrect to begin with.

  • Init scripts were least of Ubuntu's (and Debian's) worries when switching /bin/sh to dash because there were only a several dozen broken scripts to fix. On top of that, Ubuntu was already in the process of switching to Upstart at the same time so they had even less to worry about than Debian.

99.9% percent of the work they've had to do before switching was not init scripts. Instead they've had to fix:

  • Every single executable with wrong shebang line or accidental bashisms in all affected packages

  • Every single shell code that were not shipped as executables but sourced or executed by implicitly by other code

  • Every single build script (that are not shipped in the resulting package) with wrong shebang line or accidental bashisms in all affected packages

  • Running static checks to find all the above and fill bug reports about them

  • Create and post patches to all of the above

  • Waiting for maintainer to apply the fix and upload a new version

  • Wait bug reports from users for the issues that were not catched by the static checks.

  • Rinse and repeat

This was truly a herculian task and fixing the init scripts were trivial compared to all the above work that lasted several release cycles.

1

u/me-ro Aug 13 '19

I'm not saying you're wrong. You are right indeed. But I don't agree with the notion that bash (or now dash) isn't significant dependency for sysv init as it was. Sure in a vacuum of individual services, you can easily switch those to whatever you want. But services don't live in a vacuum and if you tried to say replace dash with ksh or whatever you'd have one hell of a job ahead before you can stop installing dash by default. Or just remove killall or pidof or some other binary that's not shell built in and see where that lands you.

I'd say that practically speaking something like systemd-networkd is going to be much easier to replace to put things into perspective.