def _logfile_sigterm_handler(*_):
    # type: (...) -> None
    """Handle exit signals and write out a log file.

    Raises:
        SystemExit: Contains the signal as the return code.
    """
    logging.error('Received SIGTERM.')
    write_logfile()
    print('Received signal. Please see the log file for more information.',
          file=sys.stderr)
    sys.exit(signal)
Handle exit signals and write out a log file.

    Raises:
        SystemExit: Contains the signal as the return code.