[plt-scheme] Web server pid

From: Norman Gray (norman at astro.gla.ac.uk)
Date: Tue Dec 19 14:40:38 EST 2006

Jay, hello.

On 2006 Dec 19 , at 00.52, Jay McCarthy wrote:

> The web-server doesn't do anything like. What you could do is write a
> shell script that call web-server-text with exec, the exec would cause
> bash (or sh) to exec and the new mzscheme process would have the same
> PID, so you could inspect $$.

Ach.  I'd done almost exactly this, but stuffed it up in such a way  
(doing it within a Makefile action, so $$ was expanded at the wrong  
time, so the server ended up adopted by init), that I became  
convinced that the web server cunningly daemonised itself if it was  
started without a controlling terminal.  `OK', I thought, sort-of  
impressed, `perhaps that's being a little bit _too_ clever...', and  
looked for alternatives.  It doesn't, of course; sorry 'bout that.

> Patches welcome.

Attached (thanks, Eli, for the getpid reference).

This patch (patch -Np1) patches the web-server tree to add a (pid-log- 
file-path "plt-web-server.pid") form to the configuration-table.  If  
that's present and not #f, the server writes its PID to the named  
file.  If it's not present, the pid file is written by default.  The  
patch adds default-web-root/htdocs/Defaults/documentation/terms/pid- 
log-file-path.html and fixes a typo I spotted in .../time-initial.html.

It appears to work for me, but I haven't hammered it.  I hope this is  

All the best,


Norman Gray  /  http://nxg.me.uk
eurovotech.org  /  University of Leicester, UK

-------------- next part --------------
A non-text attachment was scrubbed...
Name: web-server-pid-log.patch.gz
Type: application/x-gzip
Size: 3608 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20061219/a771b978/attachment.gz>
-------------- next part --------------

Posted on the users mailing list.