[isidorus-cvs] r651 - trunk/src/shell_scripts
lgiessmann at common-lisp.net
lgiessmann at common-lisp.net
Wed Jul 20 14:32:13 UTC 2011
Author: lgiessmann
Date: Wed Jul 20 07:32:13 2011
New Revision: 651
Log:
trunk: added a bash script that starts isidorus in the background by calling sbcl --load shell_scripts/startIsidorus.list by using start-stop-daemon
Added:
trunk/src/shell_scripts/isidorus (contents, props changed)
trunk/src/shell_scripts/startIsidorus.lisp
Added: trunk/src/shell_scripts/isidorus
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/src/shell_scripts/isidorus Wed Jul 20 07:32:13 2011 (r651)
@@ -0,0 +1,73 @@
+
+#!/bin/bash
+
+### BEGIN INIT INFO
+# Provides: isidorus
+# Required-Start: $local_fs $remote_fs $network
+# Required-Stop: $local_fs $remote_fs $network
+# Should-Start: $named
+# Should-Stop: $named
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Start Isidorus.
+# Description: Start the Isidorus server.
+### END INIT INFO
+
+. /lib/lsb/init-functions
+
+NAME=isidorus
+DPATH=/home/servreg/.sbcl/site/isidorus/src
+DAEMON="/usr/bin/sbcl"
+ARGUMENTS="--load shell_scripts/startIsidorus.lisp"
+PID=/var/run/isidorus.pid
+USER=servreg
+GROUP=servreg
+
+start_isidorus () {
+ log_daemon_msg "Starting ${NAME}"
+ #set -x
+ start-stop-daemon --background --start --group ${GROUP} --chuid ${USER} --chdir ${DPATH} --pidfile ${PID} -m --exec ${DAEMON} -- ${ARGUMENTS}
+ #set +x
+ if ps -p $(cat $PID 2> /dev/null) > /dev/null 2>&1; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+}
+
+stop_isidorus () {
+ log_daemon_msg "Stoping ${NAME}"
+
+ . ${DPATH}/shell_scripts/shutdown-isidorus.sh
+ if [ $? -eq 0 ]; then
+ log_end_msg 0
+ else
+ log_end_msg 1
+ fi
+}
+
+
+case "$1" in
+ start)
+ start_isidorus
+ ;;
+
+ stop)
+ stop_isidorus
+ ;;
+
+ restart)
+ stop_isidorus
+ sleep 5
+ start_isidorus
+ ;;
+
+ status)
+ echo TODO
+ ;;
+
+ *)
+ echo "Usage: $0 {start|stop|restart|status}" >&2
+ exit 1
+ ;;
+esac;
Added: trunk/src/shell_scripts/startIsidorus.lisp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ trunk/src/shell_scripts/startIsidorus.lisp Wed Jul 20 07:32:13 2011 (r651)
@@ -0,0 +1,10 @@
+(setf sb-impl::*default-external-format* :utf-8)
+(asdf:operate 'asdf:load-op 'isidorus)
+;;(xtm-importer:import-from-xtm "/home/servreg/.sbcl/site/isidorus/src/unit_tests/textgrid_07.15.2011.xtm" "data_base" :tm-id "http::/isidor.us/tm-1")
+(setf rest-interface:*local-backup-remote-address* "143.93.190.247")
+(setf rest-interface:*remote-backup-remote-address* "143.93.190.247")
+(setf rest-interface:*shutdown-remote-address* "127.0.0.1")
+(rest-interface:start-json-engine "/home/servreg/data_base" :host-name "143.93.190.176" :port 9999)
+(rest-interface:start-admin-server)
+(rest-interface:die-when-finished)
+
More information about the Isidorus-cvs
mailing list