Fix the nstop keyword.

This commit is contained in:
Roy Marples 2009-04-27 09:06:30 +00:00
parent e70a142956
commit 338c93733d
2 changed files with 7 additions and 4 deletions

View File

@ -59,9 +59,8 @@
#rc_start_wait=100 #rc_start_wait=100
# rc_nostop is a list of services which will not stop when changing runlevels. # rc_nostop is a list of services which will not stop when changing runlevels.
# Network clients may wish to add network to the list.
# This still allows the service itself to be stopped when called directly. # This still allows the service itself to be stopped when called directly.
#rc_nostop="network" #rc_nostop=""
# rc will attempt to start crashed services by default. # rc will attempt to start crashed services by default.
# However, it will not stop them by default as that could bring down other # However, it will not stop them by default as that could bring down other

View File

@ -607,8 +607,10 @@ do_stop_services(const char *newlevel, bool parallel)
else else
nstop = false; nstop = false;
rc_stringlist_free(kwords); rc_stringlist_free(kwords);
if (nstop) if (nstop) {
rc_service_mark(service->value, RC_SERVICE_FAILED);
continue; continue;
}
/* If the service has crashed, skip futher checks and just stop /* If the service has crashed, skip futher checks and just stop
it */ it */
@ -687,7 +689,9 @@ do_start_services(bool parallel)
TAILQ_FOREACH(service, start_services, entries) { TAILQ_FOREACH(service, start_services, entries) {
state = rc_service_state(service->value); state = rc_service_state(service->value);
if (!(state & (RC_SERVICE_STOPPED | RC_SERVICE_FAILED))) { if (state & RC_SERVICE_FAILED)
continue;
if (!(state & RC_SERVICE_STOPPED)) {
if (crashed && if (crashed &&
rc_service_daemons_crashed(service->value)) rc_service_daemons_crashed(service->value))
rc_service_mark(service->value, rc_service_mark(service->value,