From 3c76777ef10922f103616118089ed65112451879 Mon Sep 17 00:00:00 2001 From: Lionel Van Bemten Date: Tue, 20 Aug 2019 17:57:39 +0200 Subject: Do not start new transitions after sigterm was received --- src/s6-rc/s6-rc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/s6-rc/s6-rc.c b/src/s6-rc/s6-rc.c index 8f1f658..45ec880 100644 --- a/src/s6-rc/s6-rc.c +++ b/src/s6-rc/s6-rc.c @@ -44,6 +44,7 @@ static unsigned char *state ; static unsigned int *pendingdeps ; static tain_t deadline ; static char dryrun[UINT_FMT] = "" ; +static unsigned int lameduck = 0 ; static inline void announce (void) { @@ -297,7 +298,8 @@ static void on_success (unsigned int i, int h) announce() ; if (verbosity >= 2) strerr_warni5x(dryrun[0] ? "simulation: " : "", "service ", db->string + db->services[i].name, h ? " started" : " stopped", " successfully") ; - broadcast_success(i, h) ; + if (!lameduck) + broadcast_success(i, h) ; } static void on_failure (unsigned int i, int h, int crashed, unsigned int code) @@ -372,6 +374,7 @@ static int handle_signals (int h) strerr_warnw3x("received ", sig_name(sig), ", aborting longrun transitions") ; /* kill_oneshots() ; */ kill_longruns() ; + lameduck = 1 ; break ; default : strerr_dief1x(101, "inconsistent signal state") ; } -- cgit v1.2.3