If we don't have permission to inspect the pidfile, don't report crashed. Gentoo #218028.
This commit is contained in:
parent
dc5d63aa97
commit
54d7aa39dd
@ -561,14 +561,13 @@ bool rc_service_daemons_crashed(const char *service)
|
||||
if ((fp = fopen(pidfile, "r"))) {
|
||||
if (fscanf(fp, "%d", &pid) == 1)
|
||||
retval = false;
|
||||
|
||||
fclose (fp);
|
||||
}
|
||||
free(pidfile);
|
||||
pidfile = NULL;
|
||||
|
||||
/* We have the pid, so no need to match on name */
|
||||
free (name);
|
||||
free(name);
|
||||
name = NULL;
|
||||
} else {
|
||||
if (exec) {
|
||||
|
@ -103,9 +103,13 @@ static void print_service(const char *service)
|
||||
snprintf(status, sizeof(status), "inactive ");
|
||||
color = ECOLOR_WARN;
|
||||
} else if (state & RC_SERVICE_STARTED) {
|
||||
if (test_crashed && rc_service_daemons_crashed(service))
|
||||
errno = 0;
|
||||
if (test_crashed &&
|
||||
rc_service_daemons_crashed(service) &&
|
||||
errno != EACCES)
|
||||
{
|
||||
snprintf(status, sizeof(status), " crashed ");
|
||||
else {
|
||||
} else {
|
||||
snprintf(status, sizeof(status), " started ");
|
||||
color = ECOLOR_GOOD;
|
||||
}
|
||||
|
@ -559,8 +559,10 @@ static RC_SERVICE svc_status(void)
|
||||
snprintf(status, sizeof(status), "inactive");
|
||||
e = &ewarn;
|
||||
} else if (state & RC_SERVICE_STARTED) {
|
||||
errno = 0;
|
||||
if (_rc_can_find_pids() &&
|
||||
rc_service_daemons_crashed(service))
|
||||
rc_service_daemons_crashed(service) &&
|
||||
errno != EACCES)
|
||||
{
|
||||
snprintf(status, sizeof(status), "crashed");
|
||||
e = &eerror;
|
||||
|
Loading…
x
Reference in New Issue
Block a user