-
-
Notifications
You must be signed in to change notification settings - Fork 606
/
start.py
executable file
·37 lines (30 loc) · 951 Bytes
/
start.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env -S python3 -u
"""
Run a local instance of Boulder for testing purposes.
Boulder always runs as a collection of services. This script will
start them all on their own ports (see test/startservers.py)
Keeps servers alive until ^C. Exit non-zero if any servers fail to
start, or die before ^C.
"""
import errno
import os
import sys
import time
sys.path.append('./test')
import startservers
if not startservers.install(race_detection=False):
raise(Exception("failed to build"))
if not startservers.start(fakeclock=None):
sys.exit(1)
try:
os.wait()
# If we reach here, a child died early. Log what died:
startservers.check()
sys.exit(1)
except KeyboardInterrupt:
print("\nstopping servers.")
except OSError as v:
# Ignore EINTR, which happens when we get SIGTERM or SIGINT (i.e. when
# someone hits Ctrl-C after running `docker compose up` or start.py.
if v.errno != errno.EINTR:
raise