~launchpad-pqm/launchpad/devel

10637.3.15 by Guilherme Salgado
update the shebang lines of a few scripts that still had python2.5 hard-coded
1
#!/usr/bin/python -S
9590.1.135 by Michael Hudson
add files from launchpad-loggerhead tree to launchpad tree
2
#
3
# Copyright 2009, 2010 Canonical Ltd.  This software is licensed under the
4
# GNU Affero General Public License version 3 (see the file LICENSE).
5
6
import _pythonpath
7
8
import os
9
import sys
10
11
home = os.path.realpath(os.path.dirname(__file__))
12
pidfile = os.path.join(home, 'loggerhead.pid')
13
14
try:
15
    f = open(pidfile, 'r')
16
except IOError, e:
17
    print 'No pid file found.'
18
    sys.exit(1)
19
20
pid = int(f.readline())
21
22
try:
23
    os.kill(pid, 0)
24
except OSError, e:
25
    print 'Stale pid file; server is not running.'
26
    sys.exit(1)
27
28
print
29
print 'Shutting down previous server @ pid %d.' % (pid,)
30
print
31
32
import signal
33
os.kill(pid, signal.SIGTERM)