Mercurial > evolve
comparison tests/killdaemons.py @ 7:cc592295900f
Add write protocol support for private.
Writeprotocol repo doesn't need to _reducehead locally. It's the heads command
implementation server side that handle the filtering.
author | Pierre-Yves David <pierre-yves.david@logilab.fr> |
---|---|
date | Mon, 23 May 2011 15:41:20 +0200 |
parents | |
children | 88e61e45026d |
comparison
equal
deleted
inserted
replaced
6:2ec66dbe2ebe | 7:cc592295900f |
---|---|
1 #!/usr/bin/env python | |
2 | |
3 import os, time, errno, signal | |
4 | |
5 # Kill off any leftover daemon processes | |
6 try: | |
7 fp = open(os.environ['DAEMON_PIDS']) | |
8 for line in fp: | |
9 try: | |
10 pid = int(line) | |
11 except ValueError: | |
12 continue | |
13 try: | |
14 os.kill(pid, 0) | |
15 os.kill(pid, signal.SIGTERM) | |
16 for i in range(10): | |
17 time.sleep(0.05) | |
18 os.kill(pid, 0) | |
19 os.kill(pid, signal.SIGKILL) | |
20 except OSError, err: | |
21 if err.errno != errno.ESRCH: | |
22 raise | |
23 fp.close() | |
24 except IOError: | |
25 pass |