exec_kill_signal

The exec_kill_signal directive allows configuration of the signal sent to a process when terminating a stream in the NGINX RTMP module.

Syntaxexec_kill_signal signal;
DefaultTERM
Context
Arguments1

Description

The exec_kill_signal directive is a parameter used in the NGINX RTMP module to specify the signal that should be sent to an external process when a stream is terminated. This feature is particularly useful in live streaming contexts where processes such as transcoding or streaming may need to be gracefully or forcefully stopped in response to stream lifecycle events. By defining this directive, users can manage the way external applications handle the termination of streams, improving resource management and stream control.

The directive takes a single argument, which is the signal name or number (e.g., TERM, KILL) that will dictate the termination behavior of the associated process. This signal will be dispatched to the process identified in the exec directive corresponding to a stream event—enabling developers to craft a responsive streaming environment that aligns with their application logic.

Improper use of this directive, such as failing to account for the impact of sending strong termination signals (like SIGKILL), can lead to loss of data or application instability; hence, it is crucial to understand the implications of the signal being dispatched based on this configuration.

Config Example

application live {
    live on;
    exec_script /path/to/script.sh;
    exec_kill_signal TERM;
}

Using a signal that the process does not handle can terminate it unexpectedly, leading to potential data loss.

Ensure the correct signal string is used; errors in spelling may lead to ignoring the directive.

Not all signals are suitable for all use cases; evaluate the impact of each signal on your external processes.

← Back to all directives