~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to stop-loggerhead

  • Committer: John Arbash Meinel
  • Date: 2011-02-10 00:49:06 UTC
  • mto: This revision was merged to the branch mainline in revision 426.
  • Revision ID: john@arbash-meinel.com-20110210004906-o4f1ic6mt5jb9mbz
Allow comment strings in the scripts.

JSON isn't great for comments, because it doesn't allow multi-line
strings, but something is better than nothing.

Show diffs side-by-side

added added

removed removed

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