diff --git a/internal/core/rtsp_server_test.go b/internal/core/rtsp_server_test.go index 31e5510e..4b2ffc48 100644 --- a/internal/core/rtsp_server_test.go +++ b/internal/core/rtsp_server_test.go @@ -741,7 +741,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)' INT +trap 'touch %s; [ -z "$(jobs -p)" ] || kill $(jobs -p)' QUIT ffmpeg -hide_banner -loglevel error -re -i ../../testimages/ffmpeg/emptyvideo.mkv -c copy -f rtsp rtsp://localhost:$RTSP_PORT/$RTSP_PATH & wait `, doneFile))) diff --git a/internal/externalcmd/cmd_unix.go b/internal/externalcmd/cmd_unix.go index 9995a7f0..db7d64f2 100644 --- a/internal/externalcmd/cmd_unix.go +++ b/internal/externalcmd/cmd_unix.go @@ -5,6 +5,7 @@ package externalcmd import ( "os" "os/exec" + "syscall" ) func (e *Cmd) runInner() bool { @@ -31,7 +32,7 @@ func (e *Cmd) runInner() bool { select { case <-e.terminate: - cmd.Process.Signal(os.Interrupt) + syscall.Kill(cmd.Process.Pid, syscall.SIGQUIT) <-cmdDone return false