From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2562 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Jeff Newsgroups: gmane.comp.sysutils.supervision.general Subject: how to handle system shutdown ? Date: Fri, 03 May 2019 03:37:00 +0200 Message-ID: <20616231556847420@myt3-2475c4d2af83.qloud-c.yandex.net> References: <11997211556565598@myt6-27270b78ac4f.qloud-c.yandex.net> <20190501033355.6e41e707@mydesk.domain.cxm> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="110789"; mail-complaints-to="usenet@blaine.gmane.org" Cc: slitt@troubleshooters.com To: "supervision@list.skarnet.org" Original-X-From: supervision-return-2152-gcsg-supervision=m.gmane.org@list.skarnet.org Fri May 03 03:37:07 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 1hMN8M-000SeF-LZ for gcsg-supervision@m.gmane.org; Fri, 03 May 2019 03:37:06 +0200 Original-Received: (qmail 4139 invoked by uid 89); 3 May 2019 01:37:32 -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 4132 invoked from network); 3 May 2019 01:37:31 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1556847420; bh=Kdbyim97bB4AOm3fVRo5eRHTpZUPv6b04zT2/1fjv+Q=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=sGB4U6+Wh/gHlLD0ZGX24IZW4PzU/KckWbDQKOMJpzY329I0/sbh1FZld9B6tObiB B1cEDuSra180N16EIIWVXWK6b9yhxgung+MvTShKJQZpAy2NGt8JvmjQAeVHczglJ9 wBbElPagF7RFWp1VDeS3qoGf8mdeahRYIkXJi62U= Authentication-Results: mxback8o.mail.yandex.net; dkim=pass header.i=@yandex.com In-Reply-To: <20190501033355.6e41e707@mydesk.domain.cxm> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2562 Archived-At: > And of course you'd need a shutdown script that PID1 > can call when it gets signals to reboot or poweroff. that is also an interesting point. i personally added this to my init. it ran a sript with the received signal's name and number as parameters to let the user decide what to do about it (i am also used to shut my desktop down via "kill -12 1 ; exit 0"). but one can do without it and call the shutdown script by hand which in the end does the reboot(2) call itself, thats perfectly possible and the classical BSD way, so process #1 does not even need to do the system shutdown itself. but reacting to signals other than SIGCHLD is necessary on Linux (and probably also the BSDs on PC hardware) to react to incoming signals sent by the kernel when the "3 finger salute" and other recognized special key sequences are hit (Linux: SIG(INT,WINCH), dunno what the BSDs use here).