framecache: add SIGPIPE ignore, signal logging, and init:true for stable POST handling
This commit is contained in:
parent
0ed1254fd9
commit
902d985ca8
2 changed files with 5 additions and 2 deletions
|
|
@ -169,6 +169,7 @@ services:
|
||||||
build: ./services/framecache
|
build: ./services/framecache
|
||||||
profiles: [capture]
|
profiles: [capture]
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
init: true
|
||||||
ipc: host
|
ipc: host
|
||||||
shm_size: '${FC_SHM_SIZE_GB:-40}gb'
|
shm_size: '${FC_SHM_SIZE_GB:-40}gb'
|
||||||
environment:
|
environment:
|
||||||
|
|
|
||||||
|
|
@ -315,13 +315,15 @@ static void request_completed(void *cls,
|
||||||
/* ── main ──────────────────────────────────────────────────────────── */
|
/* ── main ──────────────────────────────────────────────────────────── */
|
||||||
|
|
||||||
static volatile int g_running = 1;
|
static volatile int g_running = 1;
|
||||||
|
static volatile int g_received_signal = 0;
|
||||||
|
|
||||||
static void on_signal(int sig) { (void)sig; g_running = 0; }
|
static void on_signal(int sig) { g_received_signal = sig; g_running = 0; }
|
||||||
|
|
||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
signal(SIGINT, on_signal);
|
signal(SIGINT, on_signal);
|
||||||
signal(SIGTERM, on_signal);
|
signal(SIGTERM, on_signal);
|
||||||
|
signal(SIGPIPE, SIG_IGN);
|
||||||
|
|
||||||
/* Ensure /dev/shm/framecache exists */
|
/* Ensure /dev/shm/framecache exists */
|
||||||
mkdir("/dev/shm/framecache", 0755);
|
mkdir("/dev/shm/framecache", 0755);
|
||||||
|
|
@ -352,7 +354,7 @@ int main(void)
|
||||||
nanosleep(&ts, NULL);
|
nanosleep(&ts, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "[framecache] shutting down\n");
|
fprintf(stderr, "[framecache] shutting down (signal %d)\n", g_received_signal);
|
||||||
|
|
||||||
/* Destroy all active slots */
|
/* Destroy all active slots */
|
||||||
for (int i = 0; i < FC_MAX_SLOTS; i++) {
|
for (int i = 0; i < FC_MAX_SLOTS; i++) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue