fork and thread and signal... oooooops

Jonathan Hogg jonathan at onegoodidea.com
Thu Mar 7 07:31:19 EST 2002


On 7/3/2002 11:46, in article MeIh8.104$_Z4.397 at news.hananet.net, "Jonathan
Gardner" <jgardn at alumni.washington.edu> wrote:

> Shell is really good for writing things like init scripts. All the other
> init scripts are written with shell. Python just doesn't compare to shell
> when all you want to do is start or stop or send signals to a process.
> That's what shell was built for. Writing an init script in Python makes
> about as much sense as writing your init script in Tcl or C++.

This isn't much of an argument. Python is a great deal more capable than sh
and contains much of the equipment that you'd need to invoke subtools for
with sh (grep, sed, test, kill, etc.).

The main reason why one wouldn't want to write an init script in Python is
that you might not have Python available when you need it most. A statically
linked 'sh' (and the useful subtools) residing on the boot volume is a
standard feature of any UNIX (or should be).

If pretty much everything else fails, you generally know that you can get to
a single user prompt and run shell scripts. If you've severely mangled some
library installations your Python may very well be toast - or it may be on a
file system that just got hosed.

Of course this is old-skool sysadmin. These days I guess you just boot from
the emergency CD and press the repair button or something ;-)

Jonathan




More information about the Python-list mailing list