static void memory_full(int size) {
logger(LOG_ERR, _("Memory exhausted (couldn't allocate %d bytes), exitting."), size);
- cp_trace();
exit(1);
}
static bool write_pidfile(void) {
pid_t pid;
- cp();
-
pid = check_pid(pidfilename);
if(pid) {
#ifndef HAVE_MINGW
pid_t pid;
- cp();
-
pid = read_pid(pidfilename);
if(!pid) {
Detach from current terminal, write pidfile, kill parent
*/
bool detach(void) {
- cp();
-
setup_signals();
/* First check if we can open a fresh new pidfile */
char *scriptname, *p;
int i;
- cp();
-
#ifndef HAVE_MINGW
len = xasprintf(&scriptname, "\"%s/%s\"", confbase, name);
#else
static RETSIGTYPE fatal_signal_square(int a) {
logger(LOG_ERR, _("Got another fatal signal %d (%s): not restarting."), a,
strsignal(a));
- cp_trace();
exit(1);
}
static RETSIGTYPE fatal_signal_handler(int a) {
struct sigaction act;
logger(LOG_ERR, _("Got fatal signal %d (%s)"), a, strsignal(a));
- cp_trace();
if(do_detach) {
logger(LOG_NOTICE, _("Trying to re-execute in 5 seconds..."));
static RETSIGTYPE unexpected_signal_handler(int a) {
logger(LOG_WARNING, _("Got unexpected signal %d (%s)"), a, strsignal(a));
- cp_trace();
}
static RETSIGTYPE ignore_signal_handler(int a) {