-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhtootd
executable file
·50 lines (43 loc) · 937 Bytes
/
htootd
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
#!/bin/sh
# Hunchentoot daemon
. /var/lib/hunchentoot/htoot.conf
export SBCL_HOME=${SBCL_HOME:-'/usr/local/lib/sbcl'}
export LC_CTYPE="en_US.UTF-8"
export HOME=$HT_HOME
export HT_LOG HT_CORE
SBCL=${SBCL:-'/usr/local/bin/sbcl'}
DTTY=${DTTY:-'/usr/local/bin/detachtty'}
ATTY=${ATTY:-'/usr/local/bin/attachtty'}
case "$1" in
start)
if [ ! -f $HT_CORE ] ; then
$SBCL --script $HT_CORESRC
chown "${HT_USR}:${HT_GRP}" $HT_CORE
chmod 400 $HT_CORE
fi
$DTTY \
--dribble-file $HT_DRIBBLE \
--log-file $HT_DTTYLOG \
--pid-file $HT_PIDFILE \
$HT_SOCK \
$SBCL --core $HT_CORE --load $HT_STARTUP
;;
swank)
$ATTY $HT_SOCK '(start-swank)'
;;
attach)
$ATTY $HT_SOCK
;;
log)
tail -f $HT_LOG
;;
stop)
( kill `cat $HT_PIDFILE` ) 2>/dev/null
rm -f $HT_SOCK $HT_DRIBBLE $HT_DTTYLOG
;;
*)
echo "usage: `basename $0` {start|stop|swank|log|attach}" >&2
exit 1
;;
esac
exit 0