source: trunk/src/shell_scripts/isidorus

Last change on this file was 739, checked in by lgiessmann, 13 years ago

trunk: shell_scrcipts: changed the defualt shell script for TextGrid?

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1
2#!/bin/bash
3
4### BEGIN INIT INFO
5# Provides:          isidorus
6# Required-Start:    $local_fs $remote_fs $network
7# Required-Stop:     $local_fs $remote_fs $network
8# Should-Start:      $named
9# Should-Stop:       $named
10# Default-Start:     2 3 4 5
11# Default-Stop:      0 1 6
12# Short-Description: Start Isidorus.
13# Description:       Start the Isidorus server.
14### END INIT INFO
15
16. /lib/lsb/init-functions
17
18NAME=isidorus
19DPATH=/home/isidorus/.sbcl/site/isidorus/src
20DAEMON="/usr/bin/sbcl"
21ARGUMENTS="--load shell_scripts/startIsidorus.lisp"
22PID=/var/run/isidorus.pid
23USER=isidorus
24GROUP=isidorus
25
26start_isidorus () {
27  log_daemon_msg "Starting ${NAME}"
28  #set -x
29  start-stop-daemon --background --start --group ${GROUP} --chuid ${USER} --chdir ${DPATH} --pidfile ${PID} -m --exec ${DAEMON} -- ${ARGUMENTS}
30  #set +x
31  if ps -p $(cat $PID 2> /dev/null) > /dev/null 2>&1; then
32    log_end_msg 0
33  else
34    log_end_msg 1
35  fi
36}
37
38stop_isidorus () {
39  log_daemon_msg "Stoping ${NAME}"
40 
41  . ${DPATH}/shell_scripts/shutdown-isidorus.sh
42  if [ $? -eq 0 ]; then
43    log_end_msg 0
44  else
45    log_end_msg 1
46  fi
47}
48
49
50case "$1" in
51  start)
52    start_isidorus
53  ;;
54
55  stop)
56    stop_isidorus
57  ;;
58
59  restart)
60    stop_isidorus
61    sleep 5
62    start_isidorus
63  ;;
64
65  status)
66    echo TODO
67  ;;
68
69  *)
70    echo "Usage: $0 {start|stop|restart|status}" >&2
71    exit 1
72  ;;
73esac;
Note: See TracBrowser for help on using the repository browser.