summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2009-04-26 21:16:05 +0000
committerRoy Marples <roy@marples.name>2009-04-26 21:16:05 +0000
commiteaa32c75c9bba7af0ec842d82f56a6862bbc83db (patch)
tree74b4175dd95127d5819444807722e30dd3e5792d
parent2b866f264fa2ea9cda891018234414c4f4942eb8 (diff)
downloadopenrc-eaa32c75c9bba7af0ec842d82f56a6862bbc83db.tar.gz
openrc-eaa32c75c9bba7af0ec842d82f56a6862bbc83db.tar.bz2
openrc-eaa32c75c9bba7af0ec842d82f56a6862bbc83db.tar.xz
Add the nostop keyword so that we don't stop the network init script by default.
-rw-r--r--init.d/network.in2
-rw-r--r--man/runscript.87
-rw-r--r--src/rc/rc.c12
3 files changed, 17 insertions, 4 deletions
diff --git a/init.d/network.in b/init.d/network.in
index fbfd3b2..0c1e361 100644
--- a/init.d/network.in
+++ b/init.d/network.in
@@ -13,6 +13,8 @@ depend()
need localmount
after bootmisc
provide net
+ # We don't want to stop network unless we really have to
+ keyword nostop
keyword nojail noprefix novserver
}
diff --git a/man/runscript.8 b/man/runscript.8
index c6157e8..fa8a833 100644
--- a/man/runscript.8
+++ b/man/runscript.8
@@ -1,4 +1,4 @@
-.\" Copyright 2007-2008 Roy Marples
+.\" Copyright 2007-2009 Roy Marples
.\" All rights reserved
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -22,7 +22,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd September 19, 2008
+.Dd April 26, 2009
.Dt RUNSCRIPT 8 SMM
.Os OpenRC
.Sh NAME
@@ -139,6 +139,9 @@ When in a jail, exclude this service from any dependencies. The service can
still be run directly.
.It Dv noopenvz
Same as nojail, but for OpenVZ systems.
+.It Dv nostop
+Don't stop this service when changing runlevels, even if not present.
+This includes shutting the system down.
.It Dv notimeout
Do not time out waiting for that service.
.It Dv nouml
diff --git a/src/rc/rc.c b/src/rc/rc.c
index 0336264..0a4fba1 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 */