LWN.net Logo

Shell Scripts

Shell Scripts

Posted May 6, 2010 18:21 UTC (Thu) by Thalience (subscriber, #4217)
In reply to: Shell Scripts by HelloWorld
Parent article: Poettering: Rethinking PID 1

As I read it, it isn't particularly that (ba)sh sucks. I'm no fan of that syntax either, but it isn't the issue here.

Rather, the problem is the overhead of forking a new interpreter for each script. Each of these processes incurs not only the basic fork overhead, but also has to go and re-parse a series of conf files. Several different (and complementary) ways of addressing this overhead are discussed.

One point is that a part of the system setup code (the stuff that sysvinit puts in /etc/rcS.d/) isn't really doing "script-like" stuff. It isn't constructing long unix pipelines or parsing text output from said pipelines. Rather, it runs utility programs (mount, fsck, readahead) with fixed arguments, or writes values to sysfs or procfs files. That is the portion that could usefully be integrated into the systemd binary itself. Perhaps controlled by a single conf file that systemd parses just once.

In contrast, I don't think anyone is interested in re-writing the contents of /etc/rcS.d/* as 50 individual C programs.


(Log in to post comments)

Copyright © 2012, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds