File: mzscheme.init

package info (click to toggle)
drscheme 1%3A352-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 71,608 kB
  • ctags: 55,284
  • sloc: ansic: 278,966; cpp: 63,318; sh: 32,265; lisp: 14,530; asm: 7,327; makefile: 4,846; pascal: 4,363; perl: 2,920; java: 1,632; yacc: 755; lex: 258; sed: 93; xml: 12
file content (61 lines) | stat: -rw-r--r-- 1,335 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#! /bin/bash
#
# mzserver	Start the MzScheme HTTP server.
#

# MzScheme server will not start unless the defaults files says to
if [ -f /etc/default/mzscheme ]
then
	. /etc/default/mzscheme
fi

case "$RUN_HTTPD" in
	[Nn]*)
		exit 0
		;;
esac

NAME=web-server
DAEMON=/usr/bin/mzscheme

PLTHOME=/usr/lib/plt
export PLTHOME

echo

case "$1" in
  start)
    echo -n "Starting web server: $NAME ... "
    start-stop-daemon -b -m -p /var/run/$NAME.pid --start --exec $DAEMON -- -L text-launch.ss web-server
    ;;

  force-reload)
    echo -n "Forcing reload of web server: $NAME ... "
    start-stop-daemon -p /var/run/$NAME.pid --stop --oknodo --exec $DAEMON
    sleep 10
    start-stop-daemon -b -m -p /var/run/$NAME.pid --start --exec $DAEMON -- -L text-launch.ss web-server
    ;;

  restart)
    echo -n "Restarting web server: $NAME ... "
    start-stop-daemon -p /var/run/$NAME.pid --stop --oknodo --exec $DAEMON
    start-stop-daemon -b -m -p /var/run/$NAME.pid --start --exec $DAEMON -- -L text-launch.ss web-server
    ;;

  stop)
    echo -n "Stopping web server: $NAME ... "
    start-stop-daemon -p /var/run/$NAME.pid --stop --oknodo --exec $DAEMON
    ;;
  *)
    echo "Usage: /etc/init.d/$NAME {start|stop|restart|force-reload}"
    exit 1
    ;;
esac

if [ $? == 0 ]; then
	echo "done."
	exit 0
else
	echo failed
	exit 1
fi