94 |
static void do_action(char **); /* Dispatch to the submitted action */ |
static void do_action(char **); /* Dispatch to the submitted action */ |
95 |
static void do_exit(); /* Finalize monit */ |
static void do_exit(); /* Finalize monit */ |
96 |
static void do_default(); /* Do default action */ |
static void do_default(); /* Do default action */ |
|
static int do_wakeupcall(); /* Wakeup a sleeping monit daemon */ |
|
97 |
static void handle_options(int, char **); /* Handle program options */ |
static void handle_options(int, char **); /* Handle program options */ |
98 |
static void help(); /* Print program help message to stdout */ |
static void help(); /* Print program help message to stdout */ |
99 |
static void version(); /* Print version information */ |
static void version(); /* Print version information */ |
123 |
} |
} |
124 |
|
|
125 |
|
|
126 |
|
/** |
127 |
|
* Wakeup a sleeping monit daemon. |
128 |
|
* Returns TRUE on success otherwise FALSE |
129 |
|
*/ |
130 |
|
int do_wakeupcall() { |
131 |
|
|
132 |
|
pid_t pid; |
133 |
|
|
134 |
|
if((pid= exist_daemon()) > 0) { |
135 |
|
|
136 |
|
kill(pid, SIGUSR1); |
137 |
|
log("%s daemon at %d awakened\n", prog, pid); |
138 |
|
|
139 |
|
return TRUE; |
140 |
|
|
141 |
|
} |
142 |
|
|
143 |
|
return FALSE; |
144 |
|
|
145 |
|
} |
146 |
|
|
147 |
|
|
148 |
/* ----------------------------------------------------------------- Private */ |
/* ----------------------------------------------------------------- Private */ |
149 |
|
|
150 |
|
|
394 |
|
|
395 |
} |
} |
396 |
|
|
|
|
|
|
/** |
|
|
* Wakeup a sleeping monit daemon. |
|
|
* Returns TRUE on success otherwise FALSE |
|
|
*/ |
|
|
static int do_wakeupcall() { |
|
|
|
|
|
pid_t pid; |
|
|
|
|
|
if((pid= exist_daemon()) > 0) { |
|
|
|
|
|
kill(pid, SIGUSR1); |
|
|
log("%s daemon at %d awakened\n", prog, pid); |
|
|
|
|
|
return TRUE; |
|
|
|
|
|
} |
|
|
|
|
|
return FALSE; |
|
|
|
|
|
} |
|
|
|
|
397 |
|
|
398 |
/** |
/** |
399 |
* Finalize monit |
* Finalize monit |