From owner-freebsd-arch@freebsd.org Sat Oct 28 14:52:58 2017 Return-Path: Delivered-To: freebsd-arch@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 83391E4524E for ; Sat, 28 Oct 2017 14:52:58 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from know-smtprelay-omc-5.server.virginmedia.net (know-smtprelay-omc-5.server.virginmedia.net [80.0.253.69]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client CN "Bizanga Labs SMTP Client Certificate", Issuer "Bizanga Labs CA" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id EC506716D8 for ; Sat, 28 Oct 2017 14:52:57 +0000 (UTC) (envelope-from j.deboynepollard-newsgroups@ntlworld.com) Received: from [192.168.1.5] ([86.10.211.13]) by know-smtprelay-5-imp with bizsmtp id T2rk1w0060HtmFq012rkyU; Sat, 28 Oct 2017 15:51:44 +0100 X-Originating-IP: [86.10.211.13] X-Authenticated-User: J.deBoynePollard-newsgroups@NTLWorld.COM X-Spam: 0 X-Authority: v=2.1 cv=XuEHQgx9 c=1 sm=1 tr=0 a=SB7hr1IvJSWWr45F2gQiKw==:117 a=SB7hr1IvJSWWr45F2gQiKw==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=IkcTkHD0fZMA:10 a=x7bEGLp0ZPQA:10 a=Hw8hSUHECGJrHUsrF90A:9 a=QEXdDO2ut3YA:10 From: Jonathan de Boyne Pollard Subject: New reboot flag: -c for 'power cycle' To: FreeBSD Arch , FreeBSD Hackers Message-ID: <01741ade-cd76-3e7a-2b75-0d9984a6ee90@NTLWorld.COM> Date: Sat, 28 Oct 2017 15:51:43 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Oct 2017 14:52:58 -0000 Warner Losh: > Since init has no controlling terminal, SIGWINCH is useless to it anyway. This is untrue for two reasons. First, for some years now the nosh toolset's system manager has been recognizing SIGWINCH on FreeBSD/TrueOS for Linux compatibility; as on Linux it is sent to process #1 in response to a kernel virtual terminal attention key sequence. Second, that argument is fallacious because it would also apply to controlling-terminal-generated signals such as SIGINT and clearly does not given that SIGINT is useful to process #1. So what I am doing in the nosh toolset for the forthcoming version 1.36 is this: * The compatibility shutdown command now sports a new -c/--powercycle option. * The compatibility reboot, halt, and poweroff commands now sport a new -c/--powercycle option, for the benefits of cruel system administrators. * There is a new compatibility fastpowercycle/powercycle command, with all of the same options for cruel system administrators. * system-manager now treats SIGWINCH differently on non-Linux operating systems, treading it as a request to invoke a new powercycle service. SIGRTMIN+6, unused in the systemd system, is the Linux equivalent. * system-manager now treats SIGRTMIN+16 as the underlying actual powercycle request, which it translates to either RB_POWERCYCLE if it is present in the C library headers, or RB_AUTOBOOT if it is not. * There is now a new system-control powercycle subcommand, which defaults to sending SIGWINCH/SIGRTMIN+6 or SIGRTMIN+16. * The system-control init subcommand now sports a new c/C argument, by analogy to h/H. This is of course thus reflected automatically in the compatibility telinit command and the initctl-read server.