- Log crashes to syslog.

This commit is contained in:
Magnus Edenhill 2008-02-16 20:42:13 +00:00
parent fb0d3da575
commit c4e5e6e7b8

14
main.c
View file

@ -57,6 +57,9 @@
#include "file_input.h"
#include "cwc.h"
#include "autorec.h"
#include <libhts/htsparachute.h>
int running;
int xmltvreload;
int startupcounter;
@ -100,6 +103,15 @@ handle_sigpipe(int x)
return;
}
static void
pull_chute (int sig)
{
char pwd[PATH_MAX];
getcwd(pwd, sizeof(pwd));
syslog(LOG_ERR, "HTS TV Headend crashed on signal %i (pwd \"%s\")",
sig, pwd);
}
int
main(int argc, char **argv)
@ -198,6 +210,8 @@ main(int argc, char **argv)
dispatch_init();
htsparachute_init(pull_chute);
signal(SIGUSR1, xmltvdoreload);
signal(SIGTERM, doexit);
signal(SIGINT, doexit);