From owner-freebsd-hackers@freebsd.org Fri Mar 3 22:22:06 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F2D8CF7F07 for ; Fri, 3 Mar 2017 22:22:06 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr0-x22d.google.com (mail-wr0-x22d.google.com [IPv6:2a00:1450:400c:c0c::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A69591D82 for ; Fri, 3 Mar 2017 22:22:05 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr0-x22d.google.com with SMTP id l37so82554036wrc.1 for ; Fri, 03 Mar 2017 14:22:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hNxf8bBNOCJqGReRshm6ZZlLtPOQR9u3zrLz43avrT4=; b=dzZ6uWUoTaVZjdiwLZVh4Wm7sJe1U3eDm4W7InlYMVcCJz+NT5QzEY/enP9yCNH+3S Xosu67FPnC2wrPCRLKE5hHsJ5+kEo5Tf1NYNV8SQQHGLXxKYQA8fxlekkvk7DimRwOYz Qv3BQUR1PVNQ2cnDcRWo1yCp5wetN7K9phqAfuLskdfUp10GcIyhI9p6t4CqbxVIeqat LwAfEp0TcccYz8zeUnQ+us4o11Ma9xUrtExOyzlxV1652aNQ2hSHNypxAvzCdCiQ5ErP FBDHt4/NOsKkmrrC5KbBM9+Ak7SCFkb8P8lXwvLNtBvx2JB7nHqIzro4diyvBm74QpQ7 9tCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=hNxf8bBNOCJqGReRshm6ZZlLtPOQR9u3zrLz43avrT4=; b=NyzN9RSfVW7DNhQGCP+0J9e+D2jr6t76zIwHvV5ha6cOmT/4Ke4MBAr5gKPkRmb3Ja Mhur9kbxkZ4vqFSKMznS9SIy1E2suRotoJaR29tzsbLO/f03CM9B+34PdrM/6BAZKbg4 fZjLCm7zV/9gxXtjDekymbeNLtHnJ6+BIfEwMtqkRZrIPvYWJvOdkwU0CZE9MU1E4KYZ MLLjQ+aMIboVhK6Bi2SsaTojt0aB+afDG3fXMiPD088j/HULqYZ8OfSF/LDum0uhYHuW WHULh+zWk2aHTEcKsfSHZtwOq6e0bcPbYFR9Ce03ZGPVVOwbGrR/L/PRPYu7SZY4PwgA SB4g== X-Gm-Message-State: AMke39mkSni09E1KGBmUICd3OzjV7Ew2azG4K8tm3CUhj6aJQLvhMc85eSUXprRluXrf0Q== X-Received: by 10.223.172.135 with SMTP id o7mr3975108wrc.121.1488579723105; Fri, 03 Mar 2017 14:22:03 -0800 (PST) Received: from dft-labs.eu (n1x0n-1-pt.tunnel.tserv5.lon1.ipv6.he.net. [2001:470:1f08:1f7::2]) by smtp.gmail.com with ESMTPSA id x25sm16833812wrx.27.2017.03.03.14.22.02 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 03 Mar 2017 14:22:02 -0800 (PST) Date: Fri, 3 Mar 2017 23:22:00 +0100 From: Mateusz Guzik To: Dirk-Willem van Gulik Cc: freebsd-hackers@freebsd.org Subject: Re: kill -0 --- side effect or supported Message-ID: <20170303222159.GA24794@dft-labs.eu> Mail-Followup-To: Mateusz Guzik , Dirk-Willem van Gulik , freebsd-hackers@freebsd.org References: <23F3BAC3-0D8B-4290-8DC2-818D67A0B6A9@webweaving.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <23F3BAC3-0D8B-4290-8DC2-818D67A0B6A9@webweaving.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Mar 2017 22:22:06 -0000 On Fri, Mar 03, 2017 at 11:12:26PM +0100, Dirk-Willem van Gulik wrote: > I regularly use 'kill -0 ' on FreeBSD as a way to test if a certain process is still running (but without actually sending the signal). And I think it has worked reliably since the mid 80's. > > Is it actually a properly supported use - as I recently happened to notice that it does not seem to be all that documented in kill( > The signal 0 is mostly used to check if you can deliver signals in the first place. The problem with 'is alive?' checks with this mechanism is that zombies eat up any signal sent, including 0. For a shell script this may be good enough, but chances are you want to invest into something which actually tracks children as opposed to just dropping pidfiles. -- Mateusz Guzik