rc_nostop now lists services we should not stop on shutdown.
This commit is contained in:
parent
e0dfa472d1
commit
072328ff60
@ -756,6 +756,7 @@ static void do_stop_services(const char *newlevel, bool going_down, bool paralle
|
|||||||
RC_STRING *service, *svc1, *svc2;
|
RC_STRING *service, *svc1, *svc2;
|
||||||
RC_STRINGLIST *deporder, *tmplist;
|
RC_STRINGLIST *deporder, *tmplist;
|
||||||
RC_SERVICE state;
|
RC_SERVICE state;
|
||||||
|
RC_STRINGLIST *nostop = rc_stringlist_split(rc_conf_value("rc_nostop"), " ");
|
||||||
|
|
||||||
if (! types_n) {
|
if (! types_n) {
|
||||||
types_n = rc_stringlist_new();
|
types_n = rc_stringlist_new();
|
||||||
@ -768,6 +769,12 @@ static void do_stop_services(const char *newlevel, bool going_down, bool paralle
|
|||||||
if (state & RC_SERVICE_STOPPED || state & RC_SERVICE_FAILED)
|
if (state & RC_SERVICE_STOPPED || state & RC_SERVICE_FAILED)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
/* Sometimes we don't ever want to stop a service. */
|
||||||
|
if (rc_stringlist_find(nostop, service->value)) {
|
||||||
|
rc_service_mark(service->value, RC_SERVICE_FAILED);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* We always stop the service when in these runlevels */
|
/* We always stop the service when in these runlevels */
|
||||||
if (going_down || ! start_services) {
|
if (going_down || ! start_services) {
|
||||||
pid = service_stop(service->value);
|
pid = service_stop(service->value);
|
||||||
@ -828,6 +835,8 @@ static void do_stop_services(const char *newlevel, bool going_down, bool paralle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc_stringlist_free(nostop);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void do_start_services(bool parallel)
|
static void do_start_services(bool parallel)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user