From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2585 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "Laurent Bercot" Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: race condition in killall Date: Sat, 11 May 2019 19:26:47 +0000 Message-ID: References: <20190317132532.GA22622@caspervector> <20190317153002.52c28cf7@dickeberta> <20190319124239.GA26884@caspervector> <20190319165853.6bb9f44a@flunder> <20190320051439.GA7636@caspervector> <20190504060704.GA27290@caspervector> <20190505015551.GF2595@panda> Reply-To: "Laurent Bercot" Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="4228"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: eM_Client/7.2.34711.0 To: Supervision Original-X-From: supervision-return-2175-gcsg-supervision=m.gmane.org@list.skarnet.org Sat May 11 21:26:05 2019 Return-path: Envelope-to: gcsg-supervision@m.gmane.org Original-Received: from alyss.skarnet.org ([95.142.172.232]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1hPXdE-0000wj-LT for gcsg-supervision@m.gmane.org; Sat, 11 May 2019 21:26:04 +0200 Original-Received: (qmail 31074 invoked by uid 89); 11 May 2019 19:26:28 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Original-Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Original-Received: (qmail 31067 invoked from network); 11 May 2019 19:26:28 -0000 In-Reply-To: Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2585 Archived-At: >However, both sysvinit's and BusyBox's kilall5 make a kill(-1, >SIGSTOP) call before going through the PID list and selectively >sending the requested signal (and I guess Linux does not deliver >SIGSTOP to the process that contains the call, or it would be >pointless), and make a kill(-1, SIGCONT) call when they are done, so >I'm not sure if there's actually a race condition. Right, I failed to mention that, sorry. It is true that killall5 doesn't have a real race condition... because it stops the world before killing a set of processes, and restarts the world afterwards. This is clearly not something I want to use on systems I manage, even if it technically accomplishes its goal. -- Laurent