From nobody Thu Jul 10 14:32:51 2025 X-Original-To: current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bdHPx2LpPz617Fh for ; Thu, 10 Jul 2025 14:33:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHPx0QKJz4GXm for ; Thu, 10 Jul 2025 14:33:09 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pg1-x52c.google.com with SMTP id 41be03b00d2f7-b34a71d9208so937250a12.3 for ; Thu, 10 Jul 2025 07:33:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1752157983; x=1752762783; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+gfoD4DwqU2ySCH7ENTHuE1k16zTtghF1nPa4EMPiNA=; b=AyjVv5hKt13DrsbEzaKOOnHCK8bKFM6VusJL1DZLvd/AjwxnvciI0rrQrV2jVj2tm2 +9brtEEbq8cuEiOxBS2jRTNGDEk3UGZ/Ht/mf2X5Kqb/bkMirAwFEx/f4TJ7oOPR2LYS uI4srv2m9oY011YMI2eK2Nue0oRL8nhim8YT4dbZJJxKyIBXqHX0eE+kEf74AvSD1oUo 7Dvhr0DiBbnKVhgQQSgmkKbUJjoG1w0/9R45UBMgTSt5HJQGWS8Nw/QMlPbedXLZiwDn XEtjqlkCzJgHLEXauhHLHRhgjMQpCPvQ7tlpXDU+ps7P84EYmPAAhbdNtriU9Ed1xuY4 rjjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1752157983; x=1752762783; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+gfoD4DwqU2ySCH7ENTHuE1k16zTtghF1nPa4EMPiNA=; b=ktEjPoyF/bbWhKtSIC+hT0u8klB6NgQY3USG9fMZBEt0fyDRrZ7adEpveZFM3QQibf 5cVe/6zQObemwL3U6beP8bUeMFqzGHYIo7VF/6/OydfwLoyckMeY8j7D+4UWF77jMFi/ UyXLElBatSRKcOajR9UeF6x3QvdaBtztF0oBHgbWujue2IB7mEZ/fZeKOqdyEiva/bfp JGSDSUoodEiDl7aknz1PoOqhVqM7uEDHWIB50O5nqndYZu0tBeIOr0h7jrDvu8+UqwxU StnZ9Qn002guHvgEuRJUkRo5lKSZD6ppnlywV0dBJa7/vH+H0JIxXcILJsamsg0KUj3u gj6g== X-Forwarded-Encrypted: i=1; AJvYcCVZX2eVMW4u3HaiF2BpfAZ8vBb3G6TO2yfEKP9dFdpNRbJ7U0hjq/x4NW7/h8cchz5SQYt41jzJ@freebsd.org X-Gm-Message-State: AOJu0YxwuSJlCmO1QakJto0BZiFUznwFMXbvwBR6TFwTcqQIQnBfbaOQ POIQlXAJCR+cT3NnSh/sDoadt5WWTz/4xwgvF1WDEdq9Jwdm1JOEZcYE7QWRAJKaLsoXY4PSPBc vyt0BK5VoVNcwYM3r4d3cVJSMwLsW5dxgruUikY2rv+zUu5ypBIKu+fU= X-Gm-Gg: ASbGnctp3A332otmzrmrkC6M5I8SBI5cWQ6P1inHCEhesgdp3XYmXvPzzV/2KabJsil TNp2rFPKYox9W/ssdEemXH82u4/0QV184JObTS2cQKHBaCXmmRlSA1oim5YMQ6z2vPy7WFKzcjS 5ERkz+diQjNfTnHjif1h8tvQWAWYyDdZtu4SYyDAn35u9+odaiLpVjWMV1e4+RYpCFp7BhlTt/B g== X-Google-Smtp-Source: AGHT+IGJZLiUeklFpgV1iHBdWSsz/D6CyU/4tl0oMbUhLB7LF+uLYi0/5EdofGKKuA6xx2fVkATBEgC2OcOVox4RRqc= X-Received: by 2002:a17:90a:d64e:b0:311:df4b:4b82 with SMTP id 98e67ed59e1d1-31c3ef10c16mr4571371a91.4.1752157982863; Thu, 10 Jul 2025 07:33:02 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 References: <1B1CD603-065D-436F-97D9-DDF65AB7F115@FreeBSD.org> In-Reply-To: From: Warner Losh Date: Thu, 10 Jul 2025 08:32:51 -0600 X-Gm-Features: Ac12FXzwFDBLesH38O03gg3TgEOXqCuFJSvzVmA9voMaGz4snDM_Yu5AXlodVq8 Message-ID: Subject: Re: sysctl to prevent reboot? To: Konstantin Belousov Cc: "Bjoern A. Zeeb" , Zhenlei Huang , FreeBSD Current Content-Type: multipart/alternative; boundary="00000000000028d04c0639941242" X-Rspamd-Queue-Id: 4bdHPx0QKJz4GXm X-Spamd-Bar: ---- X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] --00000000000028d04c0639941242 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, Jul 10, 2025, 8:30=E2=80=AFAM Konstantin Belousov wrote: > On Thu, Jul 10, 2025 at 01:51:47PM +0000, Bjoern A. Zeeb wrote: > > On Thu, 10 Jul 2025, Zhenlei Huang wrote: > > > > Hi, > > > > > I believe Konstantin's work [1] and [2] are precisely what you need. > > > > > > [1] > https://cgit.freebsd.org/src/commit/?id=3D7fb88c20eccc3fd2118fda2ba58d7af= e2b87f7e3 > < > https://cgit.freebsd.org/src/commit/?id=3D7fb88c20eccc3fd2118fda2ba58d7af= e2b87f7e3> > shutdown(8): refuse to run if /var/run/noshutdown is present > > > [2] > https://cgit.freebsd.org/src/commit/?id=3D384d976725a5c29734a9227fcdb6ef0= 807485c91 > < > https://cgit.freebsd.org/src/commit/?id=3D384d976725a5c29734a9227fcdb6ef0= 807485c91> > rc.d: Add precious_machine rc.conf knob to create /var/run/noshutdown > > > > Thanks! I was looking in the wrong place. > > > > That doesn't catch reboot, does it? For me that's the offending comman= d > > as I type that at the loader prompt (if I am in the correct window). > > Reboot is very different from shutdown. I never use it except on > nfs-booted > crash boxes, so I did not considered. > > If you think it is useful, I can add the check there too. > There have been other proposals that align reboot better with Linux's behavior, then a special check isn't needed. Warner > --00000000000028d04c0639941242 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Thu, Jul 10, 2025, 8:30=E2=80= =AFAM Konstantin Belousov <kostik= bel@gmail.com> wrote:
On Thu= , Jul 10, 2025 at 01:51:47PM +0000, Bjoern A. Zeeb wrote:
> On Thu, 10 Jul 2025, Zhenlei Huang wrote:
>
> Hi,
>
> > I believe Konstantin's work [1] and=C2=A0 [2] are precisely w= hat you need.
> >
> > [1] https://cgit.freebsd.org/src/commit/?id=3D7fb88c20eccc3fd2118fda2ba5= 8d7afe2b87f7e3 <https://cgit.freebsd.org/src/commit/?id=3D7fb88c20eccc3fd= 2118fda2ba58d7afe2b87f7e3>=C2=A0 =C2=A0shutdown(8): refuse to run if= /var/run/noshutdown is present
> > [2] https://cgit.freebsd.org/src/commit/?id=3D384d976725a5c29734a9227fcd= b6ef0807485c91 <https://cgit.freebsd.org/src/commit/?id=3D384d976725a5c29= 734a9227fcdb6ef0807485c91>=C2=A0 rc.d: Add precious_machine rc.conf = knob to create /var/run/noshutdown
>
> Thanks!=C2=A0 I was looking in the wrong place.
>
> That doesn't catch reboot, does it?=C2=A0 For me that's the of= fending command
> as I type that at the loader prompt (if I am in the correct window).
Reboot is very different from shutdown.=C2=A0 I never use it except on nfs-= booted
crash boxes, so I did not considered.

If you think it is useful, I can add the check there too.
<= /div>

There have been ot= her proposals that align reboot better with Linux's behavior, then a sp= ecial check isn't needed.

Warner
--00000000000028d04c0639941242--