From eaa32c75c9bba7af0ec842d82f56a6862bbc83db Mon Sep 17 00:00:00 2001
From: Roy Marples <roy@marples.name>
Date: Sun, 26 Apr 2009 21:16:05 +0000
Subject: Add the nostop keyword so that we don't stop the network init script
 by default.

---
 src/rc/rc.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

(limited to 'src/rc')

diff --git a/src/rc/rc.c b/src/rc/rc.c
index 0336264c..0a4fba11 100644
--- a/src/rc/rc.c
+++ b/src/rc/rc.c
@@ -577,10 +577,10 @@ do_stop_services(const char *newlevel, bool parallel)
 {
 	pid_t pid;
 	RC_STRING *service, *svc1, *svc2;
-	RC_STRINGLIST *deporder, *tmplist;
+	RC_STRINGLIST *deporder, *tmplist, *kwords;
 	RC_SERVICE state;
 	RC_STRINGLIST *nostop;
-	bool crashed;
+	bool crashed, nstop;
 
 	if (!types_n) {
 		types_n = rc_stringlist_new();
@@ -601,6 +601,14 @@ do_stop_services(const char *newlevel, bool parallel)
 			rc_service_mark(service->value, RC_SERVICE_FAILED);
 			continue;
 		}
+		kwords = rc_deptree_depend(deptree, service->value, "keyword");
+		if (rc_stringlist_find(kwords, "nostop"))
+			nstop = true;
+		else
+			nstop = false;
+		rc_stringlist_free(kwords);
+		if (nstop)
+			continue;
 
 		/* If the service has crashed, skip futher checks and just stop
 		   it */
-- 
cgit v1.2.3