servicemon/query_runner.py
def catch_signals():
    """
    Catch SIGHUP, SIGQUIT and SIGTERM to allow running in the background.

    When these signals are caught, a message will go to stderr.

    SIGTERM also cause a stack trace to be sent to stderr.
    """

    # register the signals to be caught
    if platform.system() != 'Windows':
        try:
            signal.signal(signal.SIGHUP, receiveSignal)
        except AttributeError as e:
            print(f'Warning: unable to add signal.SIGHUP handler: {repr(e)}')

        try:
            signal.signal(signal.SIGQUIT, receiveSignal)
        except AttributeError as e:
            print(f'Warning: unable to add signal.SIGQUIT handler: {repr(e)}')

    # SIGTERM should be available on Windows.
    try:
        signal.signal(signal.SIGTERM, receiveSignal)
    except AttributeError as e:
        print(f'Warning: unable to add signal.SIGTERM handler: {repr(e)}')

    Catch SIGHUP, SIGQUIT and SIGTERM to allow running in the background.

    When these signals are caught, a message will go to stderr.

    SIGTERM also cause a stack trace to be sent to stderr.
    
Catch SIGHUP, SIGQUIT and SIGTERM to allow running in the background.
When these signals are caught, a message will go to stderr.

SIGTERM also cause a stack trace to be sent to stderr.
Catch SIGHUP SIGQUIT and SIGTERM to allow running in the background . When these signals are caught a message will go to stderr . SIGTERM also cause a stack trace to be sent to stderr .
def catch_signals():
    if platform.system() != 'Windows':
        try:
            signal.signal(signal.SIGHUP, receiveSignal)
        except AttributeError as e:
            print(f'Warning: unable to add signal.SIGHUP handler: {repr(e)}')
        try:
            signal.signal(signal.SIGQUIT, receiveSignal)
        except AttributeError as e:
            print(f'Warning: unable to add signal.SIGQUIT handler: {repr(e)}')
    try:
        signal.signal(signal.SIGTERM, receiveSignal)
    except AttributeError as e:
        print(f'Warning: unable to add signal.SIGTERM handler: {repr(e)}')
def catch_signals ( ) : if platform . system ( ) != 'Windows' : try : signal . signal ( signal . SIGHUP , receiveSignal ) except AttributeError as e : print ( f'Warning: unable to add signal.SIGHUP handler: {repr(e)}' ) try : signal . signal ( signal . SIGQUIT , receiveSignal ) except AttributeError as e : print ( f'Warning: unable to add signal.SIGQUIT handler: {repr(e)}' ) try : signal . signal ( signal . SIGTERM , receiveSignal ) except AttributeError as e : print ( f'Warning: unable to add signal.SIGTERM handler: {repr(e)}' )
Catch SIGHUP, SIGQUIT and SIGTERM to allow running in the background.
Catch SIGHUP SIGQUIT and SIGTERM to allow running in the background .
"""
    Catch SIGHUP, SIGQUIT and SIGTERM to allow running in the background.

    When these signals are caught, a message will go to stderr.

    SIGTERM also cause a stack trace to be sent to stderr.
    """ # register the signals to be caught # SIGTERM should be available on Windows.