From owner-freebsd-arch@freebsd.org Sat Oct 28 15:30:08 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 7BA02E45EF4 for ; Sat, 28 Oct 2017 15:30:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22c.google.com (mail-io0-x22c.google.com [IPv6:2607:f8b0:4001:c06::22c]) (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 2CBD572403 for ; Sat, 28 Oct 2017 15:30:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22c.google.com with SMTP id e89so18522405ioi.11 for ; Sat, 28 Oct 2017 08:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=nGYU2ZWPBnItcaOT5DNyvM2UB1wTAg85F+PrNlqU8WM=; b=wv/qq7zuq/NFrvbBXA+u0gHfe65CuyRTxuDVq32ubG56ziKQLk/NkvjP04YrKdFDwr zz94cGyODbCfb7VjgxoOAC7bCAZw5IbfEDirXNwYpImyqE3gT6V5BrwjdRgkdC5XszhL HEltQWX7ajO2lquqbCTzQQKM/4Oj+Q0+rfj1wEF7Sumy4yl+wEBbOvKHzD5nLvy6J5eq +XE2SNAQdot3HvYF+lM85HuMgPrsAK0Ysyg/lwvnLzUo7gUrY1pb6vIZVkU81zgivbRy PSNDz5BehUgE3fsvWBypo9ICDaOSAqeNOKaj2k7lRFtoGeoDfUqQDKpmazGv9HdhFkTT P1DQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=nGYU2ZWPBnItcaOT5DNyvM2UB1wTAg85F+PrNlqU8WM=; b=mHYW2BQoO29XUcG/X7gF5CVIpjZW4HeWmKOiZZcdFp/hTbGka65m39UfawuidlWhyN 2pBqbUDY08oP6H60Grq6hVc0afg6+nSL7zcvOvf86lcoo1aQNjNDwbPShaN/z2clwtXL J/G3bJfVcjt83suT88qQMJaad49Bonm3Y1S/M7QWCaemnWPil0r6tExjtYbof3hcmfR+ GgDbgkXnuCMfIyZr79dOpu5gXz1yHtXrn1zy4C7HE1GnTAjR3MdtUYGSUQAXAV0f+Z5o fLmPQLElMDlKccsKBIb/a15pAJ6dGK75JooYjEEbFNchadBvx59fzK76s4FQpA2iTvWd A+rw== X-Gm-Message-State: AMCzsaU3UHD3YwQrylhoFhuvc1bDwqbwgHUHe/hFWr/tbzEU8S9CQT/9 nTjMDjUhtK+zVRT4QyUPfS7fKIJIpm+LVobhQZjeeA== X-Google-Smtp-Source: ABhQp+SmGvL4/KSmQtOWBHTQBq+6dSrS69BWjIar4KFPe605yKR5arDFQv5gyRt4SymXDHL7slRHK4kw0EXDpLs19P4= X-Received: by 10.36.184.5 with SMTP id m5mr5259070ite.69.1509204606969; Sat, 28 Oct 2017 08:30:06 -0700 (PDT) MIME-Version: 1.0 Sender: wlosh@bsdimp.com Received: by 10.79.57.22 with HTTP; Sat, 28 Oct 2017 08:30:06 -0700 (PDT) X-Originating-IP: [2603:300b:6:5100:817e:dabb:4900:7bcb] In-Reply-To: <01741ade-cd76-3e7a-2b75-0d9984a6ee90@NTLWorld.COM> References: <01741ade-cd76-3e7a-2b75-0d9984a6ee90@NTLWorld.COM> From: Warner Losh Date: Sat, 28 Oct 2017 09:30:06 -0600 X-Google-Sender-Auth: VlqCl_-Fxp-__35b8txd5dx0y5M Message-ID: Subject: Re: New reboot flag: -c for 'power cycle' To: Jonathan de Boyne Pollard Cc: FreeBSD Arch , FreeBSD Hackers Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.23 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 15:30:08 -0000 On Sat, Oct 28, 2017 at 8:51 AM, Jonathan de Boyne Pollard via freebsd-arch wrote: > > 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. > It's useless for its intended purpose, which is why it can be appropriated. I was completely unaware of SIGWINCH being used like this on Linux. It didn't pop up in the quick research I did before implementing this. But it would have been nice to know this sooner, but I'm OK with later since it isn't much later.. > So what I am doing in the nosh toolset for the forthcoming version 1.36 is > this: > Might want to hold off on this a smidge... See below... > * 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. > Hmmm, I like this. I'll have to add it to FreeBSD. I should have thought of it in the first place. > * 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. > It looks like all the SIGRT* signals are user defined, and can be used for any purpose by the application. It could easily be SIGRTMIN+6 as it is SIGWINCH and we could ditch SIGWINCH on FreeBSD in init as well (since it's only been in -current for a few days). Would that suffice to address the compatibility concerns? There's no reason to be gratuitously different here. > * 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. > Warner