~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to stop-loggerhead

  • Committer: Guillermo Gonzalez
  • Date: 2008-09-10 00:02:06 UTC
  • mto: This revision was merged to the branch mainline in revision 221.
  • Revision ID: guillo.gonzo@gmail.com-20080910000206-kt35kgrzu8y4472v
 * update NEWS and serve-branches man page 
 * refactored all reload logic into loggerhead.util.Reloader class

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
 
18
18
import os
19
19
import sys
 
20
from optparse import OptionParser
20
21
 
21
22
home = os.path.realpath(os.path.dirname(__file__))
22
 
pidfile = os.path.join(home, 'loggerhead.pid')
 
23
default_pidfile = os.path.join(home, 'loggerhead.pid')
 
24
parser = OptionParser(usage='usage: %prog [options]', version='%prog')
 
25
parser.add_option('-p', '--pidfile', dest="pidfile", default=default_pidfile,
 
26
                                  help="override pidfile location")
 
27
 
 
28
options, args = parser.parse_args()
 
29
if len(args) > 0:
 
30
        parser.error('No filename arguments are used, only options.')
23
31
 
24
32
try:
25
 
    f = open(pidfile, 'r')
 
33
    f = open(options.pidfile, 'r')
26
34
except IOError, e:
27
 
    print 'No pid file found.'
 
35
    print 'Pid file %s not found.' % options.pidfile
28
36
    sys.exit(1)
29
37
 
30
38
pid = int(f.readline())