apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject Re: Solaris shell
Date Sat, 22 Nov 2008 00:40:40 GMT
Here's the analysis on x86 solaris-10.x.  Please note that the shell
I am actually using is /usr/local/bin/bash as I type the commands,
and that the startup script uses the shebang #!/bin/sh which may explain
some of the more interesting results, below.

No matter which, /bin/sh, /bin/ksh and /usr/xpg4/bin/sh all will refuse
to honor the LD_LIBRARY_PATH passed on when invoking the rotatelogs binary
process, at least directly.  I am *guessing* that because we do not
invoke with a search-path option, so Solaris may be ignoring ld_library_path
library search paths.  That's my current speculation.

At JimJag's suggestion, I built a workaround using a rotatelogs.sh script;

#!/bin/sh
set > $1
LD_LIBRARY_PATH="/path/to/apache2.0/lib:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH
/path/to/apache2.0/bin/rotatelogs $*

Note that I capture that.log as the envvars before forcing any
LD_LIBRARY_PATH (substitute 2.2 for 2.0 as needed) and launching
rotatelogs to create that.log.####, and that in each case I had
modified the shebang to use the same as I was testing from httpd/apr
(e.g. this is the original /bin/sh, and I replaced it with the
#!/bin/ksh and #!/usr/xpg4/bin/sh shells when I tested each of those
particular patches to apr).

This is what I uncloaked;

/bin/sh does work, with the script.
  httpd 2.0.63/apr 0.9.17
    PATH / LD_LIBRARY_PATH are NOT inherited
    SHELL is absent (only IFS, MAILCHECK and OPTIND are set)
    The process tree;
      httpd (parent/root)
        /bin/sh rotatelogs.sh
          rotatelogs (binary)
  httpd-2.2.9/apr 1.3.2
    PATH and LD_LIBRARY_PATH are inherited
    SHELL as /usr/local/bin/bash
    The process tree;
      httpd (parent/root)
        /bin/sh -c rotatelogs.sh
          /bin/sh rotatelogs.sh
            rotatelogs (binary)

/bin/ksh essentially works
  httpd 2.0.63/apr 0.9.17
    PATH / LD_LIBRARY_PATH are NOT inherited
    SHELL reports /bin/sh
  httpd-2.2.9/apr 1.3.2
    PATH and LD_LIBRARY_PATH are inherited
    SHELL as /usr/local/bin/bash
  Both process trees;
    httpd (parent/root)
      /bin/ksh rotatelogs.sh
        rotatelogs (binary)

/usr/bin/xpg4/sh essentially works.
  httpd 2.0.63/apr 0.9.17
    PATH / LD_LIBRARY_PATH are NOT inherited
    SHELL reports /bin/sh
  httpd-2.2.9/apr 1.3.2
    PATH and LD_LIBRARY_PATH are inherited
    SHELL as /usr/local/bin/bash
  Both process trees;
    httpd (parent/root)
      /usr/bin/xpg4/sh rotatelogs.sh
        rotatelogs (binary)

We can dismiss bash since it's not terribly "solaris-ified", and is of
little interest for a lightweight shell.  (bash is feature-rich and not
a centerpiece of the solaris world.)

There is more research to do, but it's pretty obvious that /usr/sh is not
the best choice.  /bin/ksh seems a reasonable alternative.

On failure (can't resolve libiconv.so.1 for rotatelogs) /usr/xpg4/bin/sh
was miserable.  It emitted several sig 5's into the error log every second
as httpd tried to respawn the failed invocation.  Insane.

Also note we've lost error logging when we can't spin up the piped logger
process on httpd 2.2, nothing appears on the command line or in the
primary error log file, which I need to take a deeper look at.

The best of all worlds seems to be if we added an option for apr_procattr_t
that let the user pick-a-shell.  I have some further thoughts on that which
I'll explore as I work up patches to the piped logger code.


Mime
View raw message