httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sean <>
Subject Re: Shell?
Date Wed, 09 Feb 2000 01:05:03 GMT
William A. Rowe, Jr. wrote something:
{ Question for you all,
{ I'm looking at the fixes required thru NT for the command shell... I found
{ out something very interesting about the CMD.EXE shell.  For details, skip
{ to the end first and skim [NT behavior observation]...
{ I am looking at shell exec and quoted path handling throughout Apache.  What
{ I'm asking of you all, is there a reason that the spawned processes, i.e.
{ piped log arguments etc... are proxied through execs of /bin/sh and not
{ directly invoked through the exec calls?

   Apache forks processes.. Thus are done via /bin/sh.  exec calls
   are done via sh as well.  Normal way under unix is to fork processes.
   Apache is a 'process'  thingy model.  It doesn't do threads.
   (see apache 2.00 though)

{ I don't see a reason, under Win32, to involve the overhead of spawning
{ CMD.EXE or COMMAND.COM in any situation, with the possible exception of
   Ok, fine, tell that to Microsoft.

{ batch files.  I am wondering if it is not more effective to also internally
{ process shebang lines in Unix ourselves, with whatever other additional
{ processing might be required, rather than invoke the shell (memory and
{ thread overhead).

   The closest thing you'll get there is threads (under any OS).  There isn't
   a shell under unix which threads rather than forks AFAIK.  Would be handy
   though.  Dtterm under CDE does this (kinda) , can thread another 
   dt-terminal...  OK, I know its CDE but....

   win/dos/win32/(whatever) doesn't have fork.  No notion of it at all AFAIK.
   Theres is a 'start' command (if I remember right), that 'start's
   a command in another cmd shell, but...

   Under forks, the child process can remain seperate from the parent.  So
   if the parent dies the child can continue on as if nothing happened.
   Under threads, the 'child' would die as well though.

{ Just some thoughts.

  man fork

{ [NT behavior observation]
{ The following command always works at the NT CMD.EXE prompt:
{ "c:\program files\apache\rotatelogs.exe" "c:\program files\apache\logs\test"
{ 1
{ Logging output every 1 sec to <c:\progra~1\apache~1\apache\logs\test>
{ When stuffed through the CMD.EXE as the argument to /C, however, it fails
{ wityh
{ The name specified is not recognized as an
{ internal or external command, operable program or batch file.

   as a few(lot) of people on this list perhaps, whats the /C arg do ?
   (dont use windoes much, if ever, I've even wrote stuff so I wouldn't
    have to deal with it)

{ So it seems a quoted program arg is invalid to the /C syntax, while
{ acceptable to the command line.  Makes little sense to me.


View raw message