Bug 43507 - configure flag for SHELL_PATH
Summary: configure flag for SHELL_PATH
Status: NEW
Alias: None
Product: APR
Classification: Unclassified
Component: APR (show other bugs)
Version: 1.2.9
Hardware: Other Solaris
: P2 enhancement (vote)
Target Milestone: ---
Assignee: Apache Portable Runtime bugs mailinglist
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-28 10:28 UTC by Rainer Jung
Modified: 2007-09-28 10:28 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rainer Jung 2007-09-28 10:28:05 UTC
SHELL_PATH for Unix systems is set in include/arch/unix/apr_arch_threadproc.h to
/bin/sh (APR 0.9 and 1.2). This is only used inside threadproc/unix/proc.c in
function apr_proc_create() to create new processes using the shell argument
"-c". It starts a shell and tells the shell to run the command.

On Solaris /bin/sh does an additional fork when called with "-c". So
apr_proc_create(9 in fact creates two processes that run in parallel, the shell
and the command coming after "-c". This is inefficient, and e.g. when using
rotatelogs with httpd leads to confusing additional processes in the process
table (one shell process + one rotatelogs for each rotating logger).

If the SHELL_PATH were configurable from the APR configure script, one could
choose e.g. /usr/xpg4/bin/sh, an alternative sh that exists inside Solaris for a
long time, and which does only exec a "-c" command, instead of forking a second
process.

I've got no configure patch at hand, but if it would help resolving the issue, I
could produce one.