[plt-scheme] autostarting plt-web-server

From: Henk Boom (lunarc.lists at gmail.com)
Date: Sat Jan 31 14:52:20 EST 2009

2009/1/31 Doug Orleans <dougorleans at gmail.com>:
> I'd like to have the PLT web server start up automatically whenever my
> Ubuntu machine boots.
> 1. Is there a more user-friendly way to do this than to write a script
> to put into /etc/init.d?
> 2. Has anyone written such a script already?

As a purely user-space solution, I wrote a script which runs as a cron
job, running the web server in a loop (so it restarts if it goes down
for whatever reason). The script checks ps and quits if there is
already an instance of mzscheme running under my user, which was good
enough for my purposes. I don't want to paste it here, though, since
it doesn't seem to work 100% of the time (I got locked out of ssh
access because I hit my process limit a few days ago due to a related
script). In principle something like that should work, though.

A better way to make sure only one instance of the script runs at a
time would be to put a symlink to the process in a predefined place,
and check that instead.


Posted on the users mailing list.