source: subversion/sites/other/tilesAtHome_tahngo/Tools/startstop_process_uploads @ 9859

Last change on this file since 9859 was 9356, checked in by spaetz, 12 years ago

add django fastcgi starter

  • Property svn:executable set to *
File size: 1.3 KB
Line 
1#!/bin/sh
2# This starts/stops/queries the T@H uploaded tile processor.
3# It works on Debian at least. You will need to adapt path files here.
4#Shamelessly ripped from /etc/init.d/ntpd in Debian.
5#Therefore licensed under the GPL, I guess
6
7. /lib/lsb/init-functions
8DAEMON=/var/www/tah/tah_intern/process_uploads.py
9PIDFILE=/var/www/tah/var/tahngo_uploads.pid
10
11test -x $DAEMON || exit 5
12
13#if [ -r /etc/default/$NAME ]; then
14#       . /etc/default/$NAME
15#fi
16
17#if [ -e /etc/ntp.conf.dhcp ]; then
18#       NTPD_OPTS="$NTPD_OPTS -c /etc/ntp.conf.dhcp"
19#fi
20
21
22case $1 in
23        start)
24                echo "Starting T@HNGO server"
25                /sbin/start-stop-daemon --start --background --make-pidfile --oknodo --pidfile $PIDFILE --startas $DAEMON -- $TAH_OPTS
26                ;;
27        stop)
28                echo "Stopping T@HNGO server"
29                /sbin/start-stop-daemon --stop --oknodo --pidfile $PIDFILE
30                rm -f $PIDFILE
31                ;;
32        restart|force-reload)
33                $0 stop && sleep 2 && $0 start
34                ;;
35        try-restart)
36                if $0 status >/dev/null; then
37                        $0 restart
38                else
39                        exit 0
40                fi
41                ;;
42        reload)
43                exit 3
44                ;;
45        status)
46                pidofproc -p $PIDFILE $DAEMON >/dev/null
47                status=$?
48                if [ $status -eq 0 ]; then
49                        echo "T@H server is running."
50                else
51                        echo "T@H server is not running."
52                fi
53                exit $status
54                ;;
55        *)
56                echo "Usage: $0 {start|stop|restart|try-restart|force-reload|status}"
57                exit 2
58                ;;
59esac
Note: See TracBrowser for help on using the repository browser.