From 072328ff60dc56d6943b78fec8f17810424d67e2 Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Thu, 18 Sep 2008 15:13:53 +0000 Subject: rc_nostop now lists services we should not stop on shutdown. --- src/rc/rc.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/rc/rc.c') 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) -- cgit v1.2.3