From nobody Thu Jul 10 14:30:17 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 4bdHLx4BD4z6171N for ; Thu, 10 Jul 2025 14:30:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHLw6RzDz4DYb; Thu, 10 Jul 2025 14:30:32 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 56AEUIT5031128; Thu, 10 Jul 2025 17:30:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 56AEUIT5031128 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 56AEUH14031127; Thu, 10 Jul 2025 17:30:17 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 10 Jul 2025 17:30:17 +0300 From: Konstantin Belousov To: "Bjoern A. Zeeb" Cc: Zhenlei Huang , FreeBSD Current Subject: Re: sysctl to prevent reboot? Message-ID: References: <1B1CD603-065D-436F-97D9-DDF65AB7F115@FreeBSD.org> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Rspamd-Queue-Id: 4bdHLw6RzDz4DYb 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:6939, ipnet:2001:470::/32, country:US] 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=7fb88c20eccc3fd2118fda2ba58d7afe2b87f7e3 shutdown(8): refuse to run if /var/run/noshutdown is present > > [2] https://cgit.freebsd.org/src/commit/?id=384d976725a5c29734a9227fcdb6ef0807485c91 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 command > 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.