Accessing a daemon from a cgi script

Accessing a daemon from a cgi script

Post by J.R.Willia » Thu, 05 Mar 1998 04:00:00



Hello

My problem is with a cgi script and unix/linux systems.

I have a cgi script that happens to be written in C. The cgi sends a request
to a special purpose server on another machine and then waits for the reply.
The connection is TCP not UDP. The problem is that the request is received
by the special server but its reply is not returned to script. If the
special server is accessed from a normal user account then it works fine.
The problem occurs on both Linux and Sun based http servers.

It seems to be a problem with access rights and perhaps the "nobody" user,
but I am inexperienced in these matters.

Any help would be greatly appreciated.

John

--
 ----------------------------------------------
| John Williams,                               |

|                                              |
| School of Computing & information Technology |
| University of Wolverhampton                  |
 ----------------------------------------------

 
 
 

1. cgi program which is a daemon/starting daemon from cgi

Hi,

Has anyone tried starting a daemon from a cgi program. I wrote
a daemon and it loads fin from the command line. The parent
process exits as it should and the child keeps running. But
when I try calling the program as a cgi program, the cgi
program (that is the parent process) doesn't seem to exit
until the child also exits. Does anyone know what I need to
do or how I need to write my daemon which is also a cgi
program. Now my browser hangs until the daemon terminates
instead of returning really quickly - ow at least that is
what I have expected.

I tried using nested forks and setsid() but didn't seem to
affect anything.

All help would be greatly appriciated.
--
------------------------------------------------------------

 Chief Technology Officer (CTO)  Fax:   415-547-7735
 NetJet Communications           Phone: 415-547-7730
 Web Publisher to the World      http://www.netjet.com/
 ------------------------------------------------------------

2. Using DMA in the kernel

3. starting daemon from cgi/cgi process that is a daemon

4. Printing specific fields in file?

5. Apache, CGI-Scripts and Daemons

6. saving screen shots on 2.6

7. Accessing files as root in CGI-Scripts under Apache

8. FTP-Like file archive on the Web

9. Access denied to CGI Script on Apache

10. How to put HTTP/1.1 401 Access Denied to responce in CGI script

11. H: Debian 2.0r3 LINUX: Apache: CGI scripts: 403 - access forbidden

12. various levels of access for a single CGI script?

13. accessing a file in directory other than cgi script?