~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to stop-loggerhead

  • Committer: Jelmer Vernooij
  • Date: 2008-08-05 16:02:23 UTC
  • mto: (197.1.9 pathargs)
  • mto: This revision was merged to the branch mainline in revision 198.
  • Revision ID: jelmer@samba.org-20080805160223-xzti0kx7fd5ro5a1
Add manual page for serve-branches.

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
21
20
 
22
21
home = os.path.realpath(os.path.dirname(__file__))
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.')
 
22
pidfile = os.path.join(home, 'loggerhead.pid')
31
23
 
32
24
try:
33
 
    f = open(options.pidfile, 'r')
 
25
    f = open(pidfile, 'r')
34
26
except IOError, e:
35
 
    print 'Pid file %s not found.' % options.pidfile
 
27
    print 'No pid file found.'
36
28
    sys.exit(1)
37
29
 
38
30
pid = int(f.readline())
44
36
    sys.exit(1)
45
37
 
46
38
print
47
 
print 'Shutting down previous server @ pid %d.' % pid
 
39
print 'Shutting down previous server @ pid %d.' % (pid,)
48
40
print
49
41
 
50
42
import signal