The core can be gracefully shutdown by sending a SIGINT to its process.
However, this signal is also propagated to all child processes, i.e. the
forked ffmpeg processes. They will also be stopped and might reconnect.
This is not wanted. The core has to stop these processes.
The child process will now get their own session ID with setsid() before
replacing themselves with ffmpeg. This way they will not receive a SIGINT
that was meant only for the parent.
A hard limit will kill the process as soon as either CPU or memory
consumption are above a defined limit for a certain amount of time.
A soft limit will throttle the CPU usage if above a defined limit and
kill the process if memory consumption is above a defined limit. The
soft limit can be enabled/disabled on demand.
The default is hard limit.
The scheduler allows to define when a process should run. It can be either
a timestamp in RFC3339 format or a crontab expression. If a scheduler is
given, reconnect and the reconnect delay will only apply to processes that
exited as failed.
The timeout allows to define when a process should be gracefully stopped.
It is measured from the actual start of that process including all reconnects
due to failures. If the process finished regularly, the timeout will be
reset.
Because it doesn't make sense to replace the date placeholder at
process creation, it has to be replaced at every start of the process.
On process creation only the static placeholders (such as process ID)
are replaced. Dynamic placeholders (so far only "date") are not
replaced. On process start, a callback has been introduced that gives
the chance to change the command line. This is the point where
the restreamer replaces the date placeholders.
If a process has some cleanup with purge-on-delete defined, the purge
has to wait until the process actually exited. Otherwise it may happen
that the process got the signal, files are purged, but the process is
still writing some files in order to exit cleanly. This would lead to
some artefacts left on the filesystem.
For the API endpoint /v3/process two new query parameter are introduced
in order to list only processes that match a pattern for the id and the
reference: idpattern and refpattern. The pattern is a glob pattern. If
patterns for both are given, the results will be intersected. If you use
other query parameters such as id or reference, they will be applied
after the result of the pattern matching.