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 6B19D138331 for ; Mon, 7 May 2018 23:21:06 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 732D0E08F0; Mon, 7 May 2018 23:21:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 4A946E08EC for ; Mon, 7 May 2018 23:21:05 +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 0586D335C5C for ; Mon, 7 May 2018 23:21:04 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9512B260 for ; Mon, 7 May 2018 23:21:02 +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: <1525286579.0200002b8cbd061ac79b6aed4024220cd0386d2c.williamh@OpenRC> Subject: [gentoo-commits] proj/openrc:master commit in: src/rc/ X-VCS-Repository: proj/openrc X-VCS-Files: src/rc/start-stop-daemon.c X-VCS-Directories: src/rc/ X-VCS-Committer: williamh X-VCS-Committer-Name: William Hubbs X-VCS-Revision: 0200002b8cbd061ac79b6aed4024220cd0386d2c X-VCS-Branch: master Date: Mon, 7 May 2018 23:21:02 +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: 4dbd4a02-e5fa-47bb-9020-d83d97e7ef84 X-Archives-Hash: 9096a8cd6b01ea9633f2a581360b35ff commit: 0200002b8cbd061ac79b6aed4024220cd0386d2c Author: Andrey Utkin gentoo org> AuthorDate: Sat Apr 21 22:13:15 2018 +0000 Commit: William Hubbs gentoo org> CommitDate: Wed May 2 18:42:59 2018 +0000 URL: https://gitweb.gentoo.org/proj/openrc.git/commit/?id=0200002b start-stop-daemon: don't fail stopping if pidfile is gone If pidfile does not exist when we are stopping the daemon, assume it is already stopped, and report success. hostapd is an example of a daemon which removes its pidfile when it is exiting. If this daemon terminates prematurely, that is, without s-s-d involvement, then openrc fails to restart it, because s-s-d "stop" command fails when pidfile is missing. X-Gentoo-Bug: 646274 X-Gentoo-Bug-URL: https://bugs.gentoo.org/646274 src/rc/start-stop-daemon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rc/start-stop-daemon.c b/src/rc/start-stop-daemon.c index 1b565829..0b3b423f 100644 --- a/src/rc/start-stop-daemon.c +++ b/src/rc/start-stop-daemon.c @@ -661,7 +661,7 @@ int main(int argc, char **argv) parse_schedule(applet, NULL, sig); if (pidfile) { pid = get_pid(applet, pidfile); - if (pid == -1) + if (pid == -1 && errno != ENOENT) exit(EXIT_FAILURE); } else { pid = 0;