26#include <sys/resource.h>
80"This file is created when Asterisk is run with a realtime priority (-p). It\n"
81"must continue to exist, and the astcanary process must be allowed to continue\n"
82"running, or else the Asterisk process will, within a short period of time,\n"
83"slow itself down to regular priority.\n\n"
84"The technical explanation for this file is to provide an assurance to Asterisk\n"
85"that there are no threads that have gone into runaway mode, thus hogging the\n"
86"CPU, and making the Asterisk machine seem to be unresponsive. When that\n"
87"happens, the astcanary process will be unable to update the timestamp on this\n"
88"file, and Asterisk will notice within 120 seconds and react. Slowing the\n"
89"Asterisk process down to regular priority will permit an administrator to\n"
90"intervene, thus avoiding a need to reboot the entire machine.\n";
92int main(
int argc,
char *argv[])
98 fprintf(stderr,
"Usage: %s <monitor-filename> <ppid>\n", argv[0]);
113 for (parent = atoi(argv[2]); parent == getppid() ;) {
115 if (utime(argv[1],
NULL)) {
117 if ((fd = open(argv[1], O_RDWR | O_TRUNC | O_CREAT, 0777)) > -1) {
static const char explanation[]
At one time, canaries were carried along with coal miners down into a mine. Their purpose was to aler...
int main(int argc, char *argv[])