diff options
author | Roy Marples <roy@marples.name> | 2008-09-18 15:13:53 +0000 |
---|---|---|
committer | Roy Marples <roy@marples.name> | 2008-09-18 15:13:53 +0000 |
commit | 072328ff60dc56d6943b78fec8f17810424d67e2 (patch) | |
tree | 1f0b5e5c4eaf188226b7cfe48d693c5985670bd8 /src/rc | |
parent | e0dfa472d1d32268d08a91cc37606bd0ec803a11 (diff) |
rc_nostop now lists services we should not stop on shutdown.
Diffstat (limited to 'src/rc')
-rw-r--r-- | src/rc/rc.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/rc/rc.c b/src/rc/rc.c index f9cff8a9..6e1c3bba 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) |