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 10834139696 for ; Tue, 16 May 2017 00:00:34 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 25D34E0BFA; Tue, 16 May 2017 00:00:31 +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 0080EE0BFC for ; Tue, 16 May 2017 00:00:30 +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 9FF99341692 for ; Tue, 16 May 2017 00:00:29 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 41F427453 for ; Tue, 16 May 2017 00:00:28 +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: <1494627355.cbf96967f1b6dc72ae16203dfbbb844bd08e8b6b.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: cbf96967f1b6dc72ae16203dfbbb844bd08e8b6b X-VCS-Branch: master Date: Tue, 16 May 2017 00:00:28 +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: 46977ea7-8fff-4b6a-a7eb-c76636dd50af X-Archives-Hash: a08f090487e2be3f5bf3599a79989d77 commit: cbf96967f1b6dc72ae16203dfbbb844bd08e8b6b Author: William Hubbs gmail com> AuthorDate: Fri May 12 22:14:56 2017 +0000 Commit: William Hubbs gentoo org> CommitDate: Fri May 12 22:15:55 2017 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=cbf96967 supervise-daemon: save start time and respawn count before dropping privs src/rc/supervise-daemon.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/rc/supervise-daemon.c b/src/rc/supervise-daemon.c index f3335fa2..dc6d6c12 100644 --- a/src/rc/supervise-daemon.c +++ b/src/rc/supervise-daemon.c @@ -196,6 +196,14 @@ static void child_process(char *exec, char **argv, char *svcname, setsid(); + if (svcname) { +start_time = time(NULL); +from_time_t(start_time_string, start_time); + rc_service_value_set(svcname, "start_time", start_time_string); +sprintf(start_count_string, "%i", start_count); + rc_service_value_set(svcname, "start_count", start_count_string); + } + if (nicelevel) { if (setpriority(PRIO_PROCESS, getpid(), nicelevel) == -1) eerrorx("%s: setpriority %d: %s", applet, nicelevel, @@ -342,13 +350,6 @@ static void child_process(char *exec, char **argv, char *svcname, c++; } syslog(LOG_INFO, "Running command line: %s", cmdline); - if (svcname) { -start_time = time(NULL); -from_time_t(start_time_string, start_time); - rc_service_value_set(svcname, "start_time", start_time_string); -sprintf(start_count_string, "%i", start_count); - rc_service_value_set(svcname, "start_count", start_count_string); - } execvp(exec, argv); #ifdef HAVE_PAM