diff options
author | Rob Austein <sra@hactrn.net> | 2016-04-24 22:37:11 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2016-04-24 22:37:11 +0000 |
commit | b648ba9b94382fe00850c0f0de2a47aa0974f5ea (patch) | |
tree | 5becf6d5bbda6802c0bfa3026f4a5bd97e1fc1e6 /rpki/daemonize.py | |
parent | 7c822bf648b175fc6c5727acd6468647772762c1 (diff) |
Add exception handler of last resort to servers, in an attempt to get
startup error messages logged properly if at all possible. See #806.
svn path=/branches/tk705/; revision=6387
Diffstat (limited to 'rpki/daemonize.py')
-rw-r--r-- | rpki/daemonize.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rpki/daemonize.py b/rpki/daemonize.py index 472d4b33..5a1c3979 100644 --- a/rpki/daemonize.py +++ b/rpki/daemonize.py @@ -97,7 +97,8 @@ def daemon(nochdir = False, noclose = False, pidfile = None): try: pid = os.fork() except OSError, e: - sys.exit("fork() failed: %d (%s)" % (e.errno, e.strerror)) + logging.fatal("fork() failed: %d (%s)", e.errno, e.strerror) + sys.exit(1) else: if pid > 0: os._exit(0) # pylint: disable=W0212 |