Crashed is not a baselayout state as such
This commit is contained in:
parent
7274301be2
commit
fc1bfe4234
10
src/librc.c
10
src/librc.c
@ -339,9 +339,8 @@ bool rc_mark_service (const char *service, const rc_service_state_t state)
|
|||||||
if ((s != skip_state &&
|
if ((s != skip_state &&
|
||||||
s != RC_SERVICE_STOPPED &&
|
s != RC_SERVICE_STOPPED &&
|
||||||
s != RC_SERVICE_COLDPLUGGED &&
|
s != RC_SERVICE_COLDPLUGGED &&
|
||||||
s != RC_SERVICE_SCHEDULED &&
|
s != RC_SERVICE_SCHEDULED) &&
|
||||||
s != RC_SERVICE_CRASHED) &&
|
(! skip_wasinactive || s != RC_SERVICE_WASINACTIVE))
|
||||||
(! skip_wasinactive || i != RC_SERVICE_WASINACTIVE))
|
|
||||||
{
|
{
|
||||||
file = rc_strcatpaths (RC_SVCDIR, rc_parse_service_state(s), base,
|
file = rc_strcatpaths (RC_SVCDIR, rc_parse_service_state(s), base,
|
||||||
(char *) NULL);
|
(char *) NULL);
|
||||||
@ -457,11 +456,6 @@ rc_service_state_t rc_service_state (const char *service)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state & RC_SERVICE_STARTED && geteuid () == 0) {
|
|
||||||
if (rc_service_daemons_crashed (service))
|
|
||||||
state |= RC_SERVICE_CRASHED;
|
|
||||||
}
|
|
||||||
|
|
||||||
return (state);
|
return (state);
|
||||||
}
|
}
|
||||||
librc_hidden_def(rc_service_state)
|
librc_hidden_def(rc_service_state)
|
||||||
|
@ -42,11 +42,13 @@ static void print_service (char *service)
|
|||||||
} else if (state & RC_SERVICE_INACTIVE) {
|
} else if (state & RC_SERVICE_INACTIVE) {
|
||||||
snprintf (status, sizeof (status), "inactive ");
|
snprintf (status, sizeof (status), "inactive ");
|
||||||
color = ECOLOR_WARN;
|
color = ECOLOR_WARN;
|
||||||
} else if (state & RC_SERVICE_CRASHED)
|
} else if (state & RC_SERVICE_STARTED) {
|
||||||
|
if (geteuid () == 0 && rc_service_daemons_crashed (service))
|
||||||
snprintf (status, sizeof (status), " crashed ");
|
snprintf (status, sizeof (status), " crashed ");
|
||||||
else if (state & RC_SERVICE_STARTED) {
|
else {
|
||||||
snprintf (status, sizeof (status), " started ");
|
snprintf (status, sizeof (status), " started ");
|
||||||
color = ECOLOR_GOOD;
|
color = ECOLOR_GOOD;
|
||||||
|
}
|
||||||
} else if (state & RC_SERVICE_SCHEDULED) {
|
} else if (state & RC_SERVICE_SCHEDULED) {
|
||||||
snprintf (status, sizeof (status), "scheduled");
|
snprintf (status, sizeof (status), "scheduled");
|
||||||
color = ECOLOR_WARN;
|
color = ECOLOR_WARN;
|
||||||
|
3
src/rc.h
3
src/rc.h
@ -57,9 +57,6 @@ typedef enum
|
|||||||
RC_SERVICE_FAILED = 0x0200,
|
RC_SERVICE_FAILED = 0x0200,
|
||||||
RC_SERVICE_SCHEDULED = 0x0400,
|
RC_SERVICE_SCHEDULED = 0x0400,
|
||||||
RC_SERVICE_WASINACTIVE = 0x0800,
|
RC_SERVICE_WASINACTIVE = 0x0800,
|
||||||
|
|
||||||
/* Regardless of state, service may have crashed daemons */
|
|
||||||
RC_SERVICE_CRASHED = 0x1000
|
|
||||||
} rc_service_state_t;
|
} rc_service_state_t;
|
||||||
|
|
||||||
/*! Resolves a service name to its full path.
|
/*! Resolves a service name to its full path.
|
||||||
|
@ -459,10 +459,11 @@ static rc_service_state_t svc_status ()
|
|||||||
} else if (state & RC_SERVICE_INACTIVE) {
|
} else if (state & RC_SERVICE_INACTIVE) {
|
||||||
snprintf (status, sizeof (status), "inactive");
|
snprintf (status, sizeof (status), "inactive");
|
||||||
e = &ewarn;
|
e = &ewarn;
|
||||||
} else if (state & RC_SERVICE_CRASHED) {
|
} else if (state & RC_SERVICE_STARTED) {
|
||||||
|
if (geteuid () == 0 && rc_service_daemons_crashed (service)) {
|
||||||
snprintf (status, sizeof (status), "crashed");
|
snprintf (status, sizeof (status), "crashed");
|
||||||
e = &eerror;
|
e = &eerror;
|
||||||
} else if (state & RC_SERVICE_STARTED) {
|
} else
|
||||||
snprintf (status, sizeof (status), "started");
|
snprintf (status, sizeof (status), "started");
|
||||||
} else
|
} else
|
||||||
snprintf (status, sizeof (status), "stopped");
|
snprintf (status, sizeof (status), "stopped");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user