DNSSEC: fix traceback during shutdown phase

ipa-dnskeysyncd causes traceback when receive SIGTERM, SIGINT

Ticket: https://fedorahosted.org/freeipa/ticket/4657
Reviewed-By: Petr Spacek <pspacek@redhat.com>
This commit is contained in:
Martin Basti 2015-05-11 14:04:29 +02:00 committed by Petr Vobornik
parent bb6c0b9c63
commit f763b137ee

View File

@ -22,6 +22,17 @@ from ipaplatform.paths import paths
from ipapython.dnssec.keysyncer import KeySyncer
# IPA framework initialization
api.bootstrap(in_server=True, log=None) # no logging to file
api.finalize()
standard_logging_setup(verbose=True, debug=api.env.debug)
log = root_logger
#log.addHandler(systemd.journal.JournalHandler())
# Global state
watcher_running = True
ldap_connection = False
DAEMONNAME = 'ipa-dnskeysyncd'
PRINCIPAL = None # not initialized yet
WORKDIR = '/tmp' # private temp
@ -47,21 +58,10 @@ def commenceShutdown(signum, stack):
os.umask(007)
# Global state
watcher_running = True
ldap_connection = False
# Signal handlers
signal.signal(signal.SIGTERM, commenceShutdown)
signal.signal(signal.SIGINT, commenceShutdown)
# IPA framework initialization
api.bootstrap(in_server=True, log=None) # no logging to file
api.finalize()
standard_logging_setup(verbose=True, debug=api.env.debug)
log = root_logger
#log.addHandler(systemd.journal.JournalHandler())
# Kerberos initialization
PRINCIPAL = str('%s/%s' % (DAEMONNAME, api.env.host))
log.debug('Kerberos principal: %s', PRINCIPAL)