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 5E229139694 for ; Thu, 11 May 2017 16:38:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8041CE0CD5; Thu, 11 May 2017 16:38:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 5BADBE0CD5 for ; Thu, 11 May 2017 16:38:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 5B7CF33FE74 for ; Thu, 11 May 2017 16:38:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F16697436 for ; Thu, 11 May 2017 16:38:20 +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: <1494520602.df027ca4722c8755b23a65db75728b835ccca807.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: df027ca4722c8755b23a65db75728b835ccca807 X-VCS-Branch: master Date: Thu, 11 May 2017 16:38:20 +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: 14d2fe02-66c4-4ef4-aa4f-196d959a2d26 X-Archives-Hash: 2bff28c7a956bd44c4cedd90eb638f91 commit: df027ca4722c8755b23a65db75728b835ccca807 Author: William Hubbs gmail com> AuthorDate: Thu May 11 16:32:24 2017 +0000 Commit: William Hubbs gentoo org> CommitDate: Thu May 11 16:36:42 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=df027ca4 supervise-daemon: fix our status when we give up on the child process src/rc/supervise-daemon.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c index 76c9d426..13aba1a3 100644 --- a/src/rc/supervise-daemon.c +++ b/src/rc/supervise-daemon.c @@ -676,10 +676,12 @@ int main(int argc, char **argv) * result would be the same. */ if (pidfile && exists(pidfile)) unlink(pidfile); - if (svcname) + if (svcname) { rc_service_daemon_set(svcname, exec, (const char *const *)argv, pidfile, false); + rc_service_mark(svcname, RC_SERVICE_STOPPED); + } exit(EXIT_SUCCESS); } @@ -780,6 +782,14 @@ int main(int argc, char **argv) } } + if (pidfile && exists(pidfile)) + unlink(pidfile); + if (svcname) { + rc_service_daemon_set(svcname, exec, + (const char *const *)argv, + pidfile, false); + rc_service_mark(svcname, RC_SERVICE_STOPPED); + } exit(EXIT_SUCCESS); } else if (child_pid == 0) child_process(exec, argv);