From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 95C51138334 for ; Mon, 15 Oct 2018 16:52:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 55A1DE07DF; Mon, 15 Oct 2018 16:52:56 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 242B6E07EE for ; Mon, 15 Oct 2018 16:52:56 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D0576335CDE for ; Mon, 15 Oct 2018 16:52:53 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1F03A43E for ; Mon, 15 Oct 2018 16:52:52 +0000 (UTC) From: "William Hubbs" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "William Hubbs" Message-ID: <1539622242.710c874e6e3bc57b1561eb8f2108244bf24ed32e.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/rc/supervise-daemon.c X-VCS-Directories: src/rc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 710c874e6e3bc57b1561eb8f2108244bf24ed32e X-VCS-Branch: master Date: Mon, 15 Oct 2018 16:52:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 83f68c25-82fe-40d7-ac9b-4bc43627eb38 X-Archives-Hash: f1b7e321fb813aa757fcdfa6ce799e72 commit: 710c874e6e3bc57b1561eb8f2108244bf24ed32e Author: Zac Medico gmail com> AuthorDate: Sat Oct 13 19:32:45 2018 +0000 Commit: William Hubbs gentoo org> CommitDate: Mon Oct 15 16:50:42 2018 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=710c874e supervise-daemon: fix respawn_max off by one Fix the comparison between respawn_count and respawn_max so that respawn_max = 1 will allow for one respawn. Since respawn_count is incremented before the comparison, use a 'greater than' comparison so that respawn will be triggered when respawn_count is equal to respawn_max. Fixes: https://github.com/OpenRC/openrc/issues/247 Fixes: https://github.com/OpenRC/openrc/issues/248 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 4e3d22c4..27089152 100644 --- a/src/rc/supervise-daemon.c +++ b/src/rc/supervise-daemon.c @@ -510,7 +510,7 @@ static void supervisor(char *exec, char **argv) first_spawn = 0; } else respawn_count++; - if (respawn_count >= respawn_max) { + if (respawn_count > respawn_max) { syslog(LOG_WARNING, "respawned \"%s\" too many times, exiting", exec); exiting = true;