aboutsummaryrefslogtreecommitdiffstats
path: root/main/openrc/0010-Allow-0-respawn-max.patch
blob: 6316c50da41f1961673813326828d215a5481cc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Source: gentoo: William Hubbs <w.d.hubbs@gmail.com>
Remove When: OpenRC >0.41.2 is released

OpenRC docs contradict each other on the default values for respawn_max.
The real value is 10.
If infinite spawning is desired, it should be set
to 0.
However, setting it to 0 is impossible in 0.41.2.
This upstream patch fixes that.

From 54780a45826f789f1291742eb2c99be369bfe64c Mon Sep 17 00:00:00 2001
From: William Hubbs <w.d.hubbs@gmail.com>
Date: Fri, 29 Mar 2019 14:09:08 -0500
Subject: [PATCH] supervise-daemon: allow --respawn-max to be zero

---
 src/rc/supervise-daemon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c
index aaa39397..b754a42b 100644
--- a/src/rc/supervise-daemon.c
+++ b/src/rc/supervise-daemon.c
@@ -835,7 +835,7 @@ int main(int argc, char **argv)
 
 		case 'm':  /* --respawn-max count */
 			n = sscanf(optarg, "%d", &respawn_max);
-			if (n	!= 1 || respawn_max < 1)
+			if (n	!= 1 || respawn_max < 0)
 				eerrorx("Invalid respawn-max value '%s'", optarg);
 			break;