~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerheadd

  • Committer: Tres Seaver
  • Date: 2010-03-25 10:39:30 UTC
  • mto: This revision was merged to the branch mainline in revision 405.
  • Revision ID: tseaver@agendaless.com-20100325103930-h4gvwb3u4bbp4rh8
Consistent punctuation, capitalization;  remove XXX.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
#   script might not be able to kill loggerhead)
15
15
#
16
16
 
 
17
LHUSER=loggerhead
 
18
 
 
19
if [ `whoami` = "$LHUSER" ]; then                                                                                   
 
20
    SUDO=""
 
21
else                                                                                                                
 
22
    SUDO="sudo -H -u $LHUSER"
 
23
fi
 
24
 
17
25
# If serve-branches is not in your path, you will need to specify the full path:
18
26
SERVE_BRANCHES_CMD=serve-branches
19
27
 
34
42
#
35
43
 
36
44
loggerhead_process(){
37
 
    pgrep -fl "$START_CMD"
 
45
    $SUDO pgrep -fl "$START_CMD"
38
46
}
39
47
 
40
48
loggerhead_status(){
58
66
    echo "Starting loggerhead.   (See $LOG_FOLDER for details.)"
59
67
 
60
68
    # make sure the log folder is created
61
 
    mkdir -p $LOG_FOLDER
 
69
    if [ ! -d $LOG_FOLDER ]
 
70
    then
 
71
        $SUDO mkdir -p $LOG_FOLDER
 
72
    fi
62
73
    echo "" > $LOG_FILE
63
 
    python $START_CMD > $LOG_FILE 2>&1 &
 
74
    $SUDO python $START_CMD > $LOG_FILE 2>&1 &
64
75
 
65
76
    #wait a little while of some logging to appear
66
77
    log=""
77
88
 
78
89
stop_loggerhead(){
79
90
    echo "Stopping loggerhead."
80
 
    pkill -f "$START_CMD"
 
91
    $SUDO pkill -f "$START_CMD"
81
92
    loggerhead_status
82
93
}
83
94