~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerheadd

  • Committer: Marius Kruger
  • Date: 2008-10-14 12:16:22 UTC
  • mto: This revision was merged to the branch mainline in revision 240.
  • Revision ID: amanic@gmail.com-20081014121622-nfogplfxss2k3lac
extract stop and start methods

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
#
21
21
# main part
22
22
#
 
23
 
 
24
start_loggerhead(){
 
25
    python $START_CMD > $LOG_FILE 2>&1 &
 
26
    echo "Started loggerhead.   (See $LOG_FOLDER for details.)"
 
27
}
 
28
 
 
29
stop_loggerhead(){
 
30
    pkill -f "$START_CMD"
 
31
    proccess=`pgrep -fl "$START_CMD"`
 
32
    if [ -z "$proccess" ]; then
 
33
        echo "Loggerhead was stopped."
 
34
    fi
 
35
}
 
36
 
23
37
case "$1" in
24
38
    start)
25
 
        python $START_CMD > $LOG_FILE 2>&1 &
26
 
        echo "Started loggerhead.   (See $LOG_FOLDER for details.)"
 
39
        start_loggerhead
27
40
    ;;
28
41
    stop)
29
 
        pkill -f "$START_CMD"
 
42
        stop_loggerhead
30
43
    ;;
31
44
    status)
32
45
        proccess=`pgrep -fl "$START_CMD"`
36
49
            echo "Loggerhead is not running."
37
50
        else
38
51
            echo "Loggerhead is running."
39
 
            fi
 
52
        fi
40
53
    ;;
41
54
    restart)
42
 
        pkill -f "$START_CMD"
43
 
        python $START_CMD > $LOG_FILE 2>&1 &
44
 
        echo "Restarted loggerhead.   (See $LOG_FOLDER for details.)"
 
55
        stop_loggerhead
 
56
        start_loggerhead
45
57
    ;;
46
58
    *)
47
59
        echo "Usage: loggerheadd { start | stop | status | restart }"