From patchwork Thu Dec 20 22:18:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1017087 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=datacom.com.br Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43LR4N0pxtz9s55 for ; Fri, 21 Dec 2018 09:18:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 15B2487118; Thu, 20 Dec 2018 22:18:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n8DZOoCAfT8X; Thu, 20 Dec 2018 22:18:51 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 5A9568692E; Thu, 20 Dec 2018 22:18:51 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 441F71C2B5F for ; Thu, 20 Dec 2018 22:18:50 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4182A856DB for ; Thu, 20 Dec 2018 22:18:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lLIftv5ELJ8D for ; Thu, 20 Dec 2018 22:18:48 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.datacom.com.br (mx.datacom.ind.br [177.66.5.10]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 620E5856D0 for ; Thu, 20 Dec 2018 22:18:48 +0000 (UTC) Received: from mail.datacom.com.br (localhost [127.0.0.1]) by mail.datacom.com.br (Postfix) with ESMTPS id 62B331BA38DE; Thu, 20 Dec 2018 20:19:00 -0200 (-02) Received: from localhost (localhost [127.0.0.1]) by mail.datacom.com.br (Postfix) with ESMTP id 53E6F1BA38DC; Thu, 20 Dec 2018 20:19:00 -0200 (-02) Received: from mail.datacom.com.br ([127.0.0.1]) by localhost (mail.datacom.com.br [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id aYb4PKH7TGRJ; Thu, 20 Dec 2018 20:19:00 -0200 (-02) Received: from p7-1130br.casantos.org (unknown [177.18.41.165]) by mail.datacom.com.br (Postfix) with ESMTPSA id CA6601BA37C8; Thu, 20 Dec 2018 20:18:59 -0200 (-02) From: Carlos Santos To: buildroot@buildroot.org Date: Thu, 20 Dec 2018 20:18:38 -0200 Message-Id: <20181220221838.21000-1-casantos@datacom.com.br> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v2] package/shairport-sync: fix init script (stop) X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" shairport-sync creates its pidfile at /var/run/shairport-sync/, so pass that path to start-stop-daemon in the stop operation. Also pass the executable path, allowing start-stop-daemon to check if the PID matches the shairport-sync process, preventing killing some other inocent daemon. Fixes: https://bugs.busybox.net/show_bug.cgi?id=11566 Reported-by: Bin Zhang Signed-off-by: Carlos Santos --- Changes v1->v2 - Recreated patch with the PID checking part --- package/shairport-sync/S99shairport-sync | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package/shairport-sync/S99shairport-sync b/package/shairport-sync/S99shairport-sync index 5443ed138c..80b2fddbc6 100644 --- a/package/shairport-sync/S99shairport-sync +++ b/package/shairport-sync/S99shairport-sync @@ -6,16 +6,18 @@ OPTIONS="-d" case "$1" in start) printf "Starting shairport-sync: " - start-stop-daemon -S -q -p /var/run/shairport-sync.pid --exec /usr/bin/shairport-sync -- $OPTIONS + start-stop-daemon -S -q --exec /usr/bin/shairport-sync -- $OPTIONS [ $? = 0 ] && echo "OK" || echo "FAIL" ;; stop) printf "Stopping shairport-sync: " - start-stop-daemon -K -q -p /var/run/shairport-sync.pid + start-stop-daemon -K -q --exec /usr/bin/shairport-sync \ + -p /var/run/shairport-sync/shairport-sync.pid [ $? = 0 ] && echo "OK" || echo "FAIL" ;; restart) $0 stop + sleep 1 $0 start ;; *)