From owner-freebsd-hackers@freebsd.org Sat Oct 28 15:30:08 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 7B23AE45EF3 for ; Sat, 28 Oct 2017 15:30:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-io0-x22d.google.com (mail-io0-x22d.google.com [IPv6:2607:f8b0:4001:c06::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 1D23472402 for ; Sat, 28 Oct 2017 15:30:08 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-io0-x22d.google.com with SMTP id f20so18546546ioj.9 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=Ab9/HzAxuQypB9+JKN2z7ah5oXi9or5g2CaijCqsrPs1XKbqTaCKaKeadtMkwzcTTr xk5f59rHYFpk8gmHc1lB64O2xtJnpmtJXxRYGCoVrlH2NP/u+GtIf2VYuPC7+41z5IRV 7puxmoWpBTfTTZJEOZUdqxuiiPkePh7m54k+jAtua2C6ZzHoTkwCyNRe/jm30Qn66lLX /PsxLxjksBkGvSd9Bid/B5/ES2Wvo61ljIDRiUjCLz/NwyRP6NTEVNziBpHNyfa9RtUQ Hdl+gnWCGYNdrTG7sWq0VbDdCKaRb/SOmaIJicnDN+kLb2V8XNK28HbSn0I9KfAC/gL3 RTAA== X-Gm-Message-State: AMCzsaWf8oBPtVVrC3yStfFGDmJfNjBXqWpvG/6AA/xk28xRcoKhhxZ8 JTQkhGg2Wk8ACZ5Vc2WHlhLqrLe6lTfe1hftJQgKGQ== 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-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: 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