Codebase list openrc / a3555b1
Add debug logging to start-stop-daemon and rc-supervisor This will make it easier to track down why the supervisor intermittently hangs after it runs for a long time. William Hubbs 5 years ago
1 changed file(s) with 18 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
2727 #include <stdio.h>
2828 #include <stdlib.h>
2929 #include <string.h>
30 #include <syslog.h>
3031 #include <time.h>
3132 #include <unistd.h>
3233 #include <sys/stat.h>
269270 einfo("Would send signal %d to PID %d", sig, pi->pid);
270271 nkilled++;
271272 } else {
272 if (!quiet)
273 ebeginv("Sending signal %d to PID %d", sig, pi->pid);
273 if (sig) {
274 syslog(LOG_DEBUG, "Sending signal %d to PID %d", sig, pi->pid);
275 if (!quiet)
276 ebeginv("Sending signal %d to PID %d", sig, pi->pid);
277 }
274278 errno = 0;
275279 killed = (kill(pi->pid, sig) == 0 ||
276280 errno == ESRCH ? true : false);
278282 eendv(killed ? 0 : 1,
279283 "%s: failed to send signal %d to PID %d: %s",
280284 applet, sig, pi->pid, strerror(errno));
285 else if (!killed)
286 syslog(LOG_ERR, "Failed to send signal %d to PID %d: %s",
287 sig, pi->pid, strerror(errno));
281288 if (!killed) {
282289 nkilled = -1;
283290 } else {
309316 if (!(pid > 0 || exec || uid || (argv && *argv)))
310317 return 0;
311318
312 if (exec)
319 if (exec) {
313320 einfov("Will stop %s", exec);
314 if (pid > 0)
321 syslog(LOG_DEBUG, "Will stop %s", exec);
322 }
323 if (pid > 0) {
315324 einfov("Will stop PID %d", pid);
316 if (uid)
325 syslog(LOG_DEBUG, "Will stop PID %d", pid);
326 }
327 if (uid) {
317328 einfov("Will stop processes owned by UID %d", uid);
329 syslog(LOG_DEBUG, "Will stop processes owned by UID %d", uid);
330 }
318331 if (argv && *argv) {
319332 einfovn("Will stop processes of `");
320333 if (rc_yesno(getenv("EINFO_VERBOSE"))) {