How can I have AMPS ignore SIGHUP?

By default, AMPS executes a controlled shutdown when SIGHUP is received. In some cases, particularly in testing environments, it's useful to configure AMPS to ignore the SIGHUP signal delivered when a terminal exits.

AMPS runs a controlled shutdown for SIGHUP because, by default, AMPS installs the amps-action-do-shutdown action as the action to run in response to the SIGHUP signal. To request that AMPS ignore that signal, you can simply replace the default action with a different action.

For example, to cause AMPS to ignore the signal entirely, you could install an action like the following:

<Actions>
    ...

     <Action>
      <On>
        <Module>amps-action-on-signal</Module>
        <Options>
          <Signal>SIGHUP</Signal>
        </Options>
      </On>
      <Do>
        <Module>amps-action-do-nothing</Module>
      </Do>
    </Action>
</Actions>
      
    

This configuration replaces the default action with the amps-action-do-nothing action. As the name implies, that action does nothing. The effect is to cause AMPS to take no action when it receives SIGHUP, effectively ignoring the signal.

You can use the same technique with most other signals. More details on configuring Actions to handle signals are provided in the AMPS User Guide.

Keywords: SIGHUP, ignoring signals, AMPS signal handling, SIGINT, Linux signals

Last updated