Feature #2594

Option of what signal to kill process from mpeg-ts pipe

Added by Phil Uithoven over 2 years ago. Updated over 1 year ago.

Status:FixedStart date:2015-01-05
Priority:NormalDue date:
Assignee:-% Done:

100%

Category:IPTV
Target version:4.2

Description

For custom mpeg-ts input pipe from IPTV (https://tvheadend.org/projects/tvheadend/wiki/Custom_MPEG-TS_Input), currently this sends signal SIGKILL to terminate the spawned process for the pipe when the pipe is to be closed. If the pipe is defined using a script, this causes the script to be terminated with no way to trap the termination signal. Without being able trap the signal, there's no way for the script to kill any spawned child processes. I realize that SIGKILL is the simplest way to make sure that a directly spawned process is terminated, but it doesn't play well with allowing proper shutdown of normal processes or with scripts.

I suggest creating an option to be able to choose what signal to use - the default can remain SIGKILL. Alternatively, make this try SIGINT first, then if process is still alive after a timeout, send SIGKILL.

This seems to be handled under input/mpegts/iptv/iptv_pipe.c

Associated revisions

Revision 59e62cb1
Added by Jaroslav Kysela almost 2 years ago

IPTV: pipe - allow to select terminate signal with forced kill (timeout), fixes #2594

History

#1 Updated by Rafal Kupiec over 2 years ago

Combo box allowing to choose from SIGKILL, SIGINT and SIGQUIT could be very handy IMHO.

#2 Updated by Phil Uithoven over 2 years ago

Rafal Kupiec wrote:

Combo box allowing to choose from SIGKILL, SIGINT and SIGQUIT could be very handy IMHO.

Yes, and if going that way, I'd say a system-wide default selection, and a per-mux selection if you need it to be different from the default (if you're using different IPTV services or pipe methods).

#3 Updated by Rafal Kupiec over 2 years ago

Phil Uithoven wrote:

Rafal Kupiec wrote:

Combo box allowing to choose from SIGKILL, SIGINT and SIGQUIT could be very handy IMHO.

Yes, and if going that way, I'd say a system-wide default selection, and a per-mux selection if you need it to be different from the default (if you're using different IPTV services or pipe methods).

Option just per MUX would be enough.

#4 Updated by Jaroslav Kysela almost 2 years ago

  • Target version set to 4.2

#5 Updated by Jaroslav Kysela almost 2 years ago

  • Status changed from New to Fixed
  • % Done changed from 0 to 100

#6 Updated by Phil Uithoven over 1 year ago

Jaroslav Kysela wrote:

Applied in changeset tvheadend|59e62cb1959656f28d136260ae4a0148b777d65d.

(/) All good, thanks!

Also available in: Atom PDF