[Linux-ha-dev] Re: cronjobs v1.2 rc1 OCF resource agent now
available
David Lee
t.d.lee at durham.ac.uk
Thu Jul 17 04:15:21 MDT 2008
On Thu, 17 Jul 2008, Lars Marowsky-Bree wrote:
> We pull in XML libraries, python, perl, tls, not to mention that the
> cluster will usually be hosting an actual application or several, but
> then try to not require bash - a package which is smaller than even the
> heartbeat package.
>
> That is, sorry, a complete waste of time. I never understood why the
> project even bothered, and figure it must be some archaic time where
> bash was not universally available.
Let's split this into 'history' and 'current', because I think there may
be differences, recognition of which might pull our thoughts together
towards closer harmony.
History:
The _history_ is that the GNU Coding Standards 7.2.2 still (10 June 2008
revision) state:
"Don't use any special features of ksh or bash, or posix features not
widely supported in traditional Bourne sh."
This is in the context of Makefiles, but its underlying principle is about
(non-)availability of software across the wide range of UNIX-like systems.
So to keep 'heartbeat' portable (and not fall into the Microsoft "We are
the only world" mentality), that led to the historical decisions about
requiring Bourne-only programming.
Hence the explanation (good, I think) for a relatively conservative
approach to programming the portability of 'heartbeat'.
Current:
That was then, and this is now. In those early days, Solaris (and other
OSes) didn't have bash. These days, the currently supported versions of
Solaris do have bash available (but I don't know about other OSes).
I hope we still try to follow portability principles (i.e. to avoid the
Microsoft world-domination mindset) where reasonably possible.
The outcomes of those principles themselves evolve. That evolution seems
to be what the current discussion is about.
Towards conclusions:
"Should the project now assume 'bash'?" is a worthwhile question for Lars
to ask.
Solaris: I think assuming 'bash' would now (unlike back then) be
reasonable; 'bash' has been distributed since Solaris 2.8. In my early
'heartbeat' days, I was working on 2.6 and 2.7 which didn't have bash.
*BSD: that needs Matt Soffen to indicate whether currently supported *BSDs
have 'bash' (or something like it) reasonably available.
Darwin. it's on our list of 'heartbeat' OSes. Anyone have any knowledge
of current versions and 'bash'?
Commerical OSes often need to have long support periods, perhaps
approaching a decade (or more).
Whatever the outcome, the first line (the "#!...") of a script *must*
accurately reflect which shell is wanted. If a script includes bashisms
then it should at least start "#!/bin/bash", not "#!/bin/sh".
Hope that helps.
Changing subject a little, but reltaed principles:
For the record: a few months ago I put in a couple of patches to the Hg
repository to try to persuade it to work with a Sun compiler.
Lars expressed his concern about this, wondering whether we simply say
"heartbeat requires gcc". Lars's thought was a good thought.
And in retrospect I think I would agree with Lars about 'gcc'. (So feel
free to back out my patches.)
--
: David Lee I.T. Service :
: Senior Systems Programmer Computer Centre :
: UNIX Team Leader Durham University :
: South Road :
: http://www.dur.ac.uk/t.d.lee/ Durham DH1 3LE :
: Phone: +44 191 334 2752 U.K. :
More information about the Linux-HA-Dev
mailing list