~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerheadd

  • Committer: Martin Albisetti
  • Date: 2008-11-17 02:13:23 UTC
  • mfrom: (228.1.6 loggerheadd)
  • Revision ID: martin.albisetti@canonical.com-20081117021323-r1d2ilvrvuzxm6t2
Add startup script for linux (Marius Kruger)

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