[geeks] Mac definitions

Mike Meredith very at zonky.org
Sat Jul 9 03:50:31 CDT 2011


On Fri, 8 Jul 2011 16:50:47 -0500 (CDT), Jonathan Patschke wrote:
> On Fri, 8 Jul 2011, Mike Meredith wrote:
> 
> > Renaming the binary is perhaps going a little further than normal,
> > but frankly Apache is a poor example here. The binary should never
> > have been named 'httpd' ... what if you're running different
> > 'httpd's ?
> 
> You can always do it the SysV way:
>          /opt/*/sbin/httpd

Yes. And indeed that is how I did it - the last time I compiled Apache
from source was installed in /opt/apache (I don't really count what I
do under FreeBSD to install Apache as compiling from source).

But it doesn't strictly speaking solve the problem completely ... even
ignoring the shared library issue. Whilst Apache doesn't seem to do it
(at least under FreeBSD or Solaris), some daemons change their process
name to expose useful information. If Apache did do that you might end
up with "httpd: [10.67.8.87]" and "httpd: [10.67.9.78]" with no clear
indication that the two httpd's were different.

And yes sometimes there's good reasons for running two different
versions of Apache on the same machine. For variable values of the word
'good' mind you :)

> If Unix library-search paths were as sane as Windows[0], this would
> work a lot better.  I've pondered before a tool that would edit the
> executable header to "firm-code" a path at installation.  It's not
> relying on ld.so's configuration, and it's not set by -rpath, but by,
> say, /usr/bin/install. That'd require leaving patch space in the
> executable header for replacing the library name with up to PATH_MAX
> characters.

Personally I'd prefer to see something like ld.so being capable of
picking up a configuration file in the same directory as the binary to
customise the library search path. Something like when you
invoke /opt/apache/sbin/httpd, it would check if there's
an /opt/apache/sbin/ld.so.conf file. Probably all sorts of problems
with that though.




-- 
Mike Meredith (http://zonky.org/)
 By the way, you DON'T want to see what a meat layer buffer overrun
 looks like.... (mjr on fw-wiz)


More information about the geeks mailing list