~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerheadd

  • Committer: Matt Nordhoff
  • Date: 2009-05-29 13:26:20 UTC
  • mfrom: (356.1.1 trunk)
  • Revision ID: mnordhoff@mattnordhoff.com-20090529132620-jlb2il586qa46y7o
Fix displaying symlinks to nonexistent targets in the directory UI. (Jelmer Vernooij)

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