summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rc/rc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rc/rc.c b/src/rc/rc.c
index f9cff8a..6e1c3bb 100644
--- a/src/rc/rc.c
+++ b/src/rc/rc.c
@@ -756,6 +756,7 @@ static void do_stop_services(const char *newlevel, bool going_down, bool paralle
RC_STRING *service, *svc1, *svc2;
RC_STRINGLIST *deporder, *tmplist;
RC_SERVICE state;
+ RC_STRINGLIST *nostop = rc_stringlist_split(rc_conf_value("rc_nostop"), " ");
if (! types_n) {
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)
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 */
if (going_down || ! start_services) {
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)