Browse Source

close custom commands with SIGINT again (#495)

pull/666/head v0.17.4
aler9 4 years ago
parent
commit
0d15e2772a
  1. 2
      internal/core/rtsp_server_test.go
  2. 2
      internal/externalcmd/cmd_unix.go

2
internal/core/rtsp_server_test.go

@ -719,7 +719,7 @@ func TestRTSPServerFallback(t *testing.T) { @@ -719,7 +719,7 @@ func TestRTSPServerFallback(t *testing.T) {
func TestRTSPServerRunOnDemand(t *testing.T) {
doneFile := filepath.Join(os.TempDir(), "ondemand_done")
onDemandFile, err := writeTempFile([]byte(fmt.Sprintf(`#!/bin/sh
trap 'touch %s; [ -z "$(jobs -p)" ] || kill $(jobs -p)' QUIT
trap 'touch %s; [ -z "$(jobs -p)" ] || kill $(jobs -p)' INT
ffmpeg -hide_banner -loglevel error -re `+
`-i ../../testimages/ffmpeg/emptyvideo.mkv -c copy -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH &
wait

2
internal/externalcmd/cmd_unix.go

@ -32,7 +32,7 @@ func (e *Cmd) runInner() bool { @@ -32,7 +32,7 @@ func (e *Cmd) runInner() bool {
select {
case <-e.terminate:
syscall.Kill(cmd.Process.Pid, syscall.SIGQUIT)
syscall.Kill(cmd.Process.Pid, syscall.SIGINT)
<-cmdDone
return false

Loading…
Cancel
Save