Hi Alex;
Due to frustrations working with Pico Lisp on MacOSX10.5 I recently
implemented a Debian Linux server. I was wondering how to go about
creating a Pico Lisp init.d script within Debian possibly with a
modification of the following server init.d script (how should I do
this?):
#! /bin/sh
### BEGIN INIT INFO
# Provides: httpGate
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the picolisp httpGate server
# Description: starts picolisp httpGate using start-stop-daemon
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/local/lib/picolisp/bin/httpGate
NAME=httpGate
DESC=httpGate
test -x $DAEMON || exit 0
# Include httpGate defaults if available
if [ -f /etc/default/httpGate] ; then
. /etc/default/httpGate
fi
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON -- $DAEMON_OPTS || true
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
--exec $DAEMON || true
echo "$NAME."
;;
restart|force-reload)
echo -n "Restarting $DESC: "
start-stop-daemon --stop --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON || true
sleep 1
start-stop-daemon --start --quiet --pidfile \
/var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS || true
echo "$NAME."
;;
reload)
echo -n "Reloading $DESC configuration: "
start-stop-daemon --stop --signal HUP --quiet --pidfile /var/
run/$NAME.pid \
--exec $DAEMON || true
echo "$NAME."
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
exit 1
;;
esac
exit 0
Best regards,
Anthony
On Jul 2, 2008, at 9:59 AM, Alexander Burger wrote:
Hi Andrei,
basically, there is no problem to run PicoLisp as an application
server
as a normal user, as long as you don't use a port below 1024. So you
must have your users connect to http://host:8080 or similar, which is
not so nice.
The standard way in PicoLisp is therefore to start 'httpGate' as root,
usually twice (listening on port 80 (HTTP) and 443 (HTTPS)).
'httpGate'
works as a proxy, dispatches all requests to applications running on
e.g. 8080, and also handles encryption/decryption in case of HTTPS.
On our servers, I usually have an init.d script that does something
like
cd /home/app
bin/httpGate 80 8080
bin/httpGate 443 8080 shop/pem
Voila, that's all
because I can't see any other means to get picoserver running aside
httpd.
Yes, when there is an Apache listening on port 80, 'httpGate' won't
even
start.
it be started and working? How much CPU time will consume this
process?
This depends very much on the task at hand, of course. But usually,
the
load is very low and not a problem at all.
Sorry if I have a silly idea to use pico as web server...
Not a bad idea at all. In fact, all applications at my customer's
sites
are ran in that way.
Cheers,
- Alex
--
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]
--
UNSUBSCRIBE: mailto:[EMAIL PROTECTED]