5 #ifndef CVMFS_MONITOR_H_
6 #define CVMFS_MONITOR_H_
10 #include <sys/types.h>
44 void Spawn(
const std::string &crash_dump_path);
82 static void SendTrace(
int sig, siginfo_t *siginfo,
void *context);
111 #endif // CVMFS_MONITOR_H_
std::map< int, struct sigaction > SigactionMap
std::string GenerateStackTrace(pid_t pid)
std::string ReportStacktrace()
static void ReportSignalAndTerminate(int sig, siginfo_t *siginfo, void *context)
SigactionMap old_signal_handlers_
static void SendTrace(int sig, siginfo_t *siginfo, void *context)
void LogEmergency(std::string msg)
static Watchdog * instance_
UniquePtr< Pipe > pipe_listener_
The supervisee makes sure its watchdog does not die.
stack_t sighandler_stack_
static Watchdog * Create(FnOnCrash on_crash)
pthread_t thread_listener_
Watchdog(FnOnCrash on_crash)
UniquePtr< Pipe > pipe_watchdog_
Communication channel from the supervisee to the watchdog.
std::string ReadUntilGdbPrompt(int fd_pipe)
static void * MainWatchdogListener(void *data)
SigactionMap SetSignalHandlers(const SigactionMap &signal_handlers)
UniquePtr< Pipe > pipe_terminate_
Send the terminate signal to the listener.
static const unsigned kSignalHandlerStacksize
void Spawn(const std::string &crash_dump_path)
platform_spinlock lock_handler_
std::string crash_dump_path_
static const unsigned kMaxBacktrace