From nobody Thu Jul 10 14:38:47 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 4bdHXV2j60z617gX for ; Thu, 10 Jul 2025 14:38:50 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx-01.divo.sbone.de (mx-01.divo.sbone.de [IPv6:2003:a:140a:2200:6:594:fffe:19]) (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-signature ECDSA (prime256v1) client-digest SHA256) (Client CN "mx-01.divo.sbone.de", Issuer "E5" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bdHXV1nDdz4JmB; Thu, 10 Jul 2025 14:38:50 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Authentication-Results: mx1.freebsd.org; none Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by mx-01.divo.sbone.de (Postfix) with ESMTPS id 2658AA64805; Thu, 10 Jul 2025 14:38:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=zabbadoz.net; s=20240622; t=1752158325; bh=XMi9V/HdKmpmALxvY5yJD+mTaItPz+AkRXhPvZ6+TdA=; h=Date:From:To:cc:Subject:In-Reply-To:References; b=HK6xVWpA2IwVysTzdztXcPOFbFMsd+0kaBQz8s9SFwCC5nj3fmltRfZQxhIoJtgd1 zcbkmdcrvD9RgntaKWbseV1SvD427pjKeg4eDH1GHsdpEXSfmJPGIUDYwgEg1BffBP SZLb3YgFeIpp3AWWkjMbY+Mcf5s77bOREBwI8yXRvze3Xqk0TG9w8EmhTiDPfCQIoT EhYOfd9OPJxb9Vyrb2YOo9i8t2Xm/TzzRjx7LLrTd2ByrarjqnbkQvx8rlzcIQS3ba BuYgKJ/JpL3VapwiYHXyKiRl8YUHITftEOK/64L9AUZDI6q23rFlAMD4jNgeo1PhIL h249IT79YYGc5qBVKqR7njAH5de/cGpcxA3R70fYJzqyOMSFue8SlENuycl1t3q8Ut 5ANuHc1PF/Cl6xuZrjYdbaxdrXWiK07DzDDIZt4NHczpzSVAhakwHhIvcmdYohGOwZ 6vrRj5z0VCMjlH7WkT+d0NGYCXXVXnRMpxH5WxaTG5Iep6zSnuUF42vwjlvT6sIqO3 QkhiIaF091qG9jknYlR8uS5nYq0scQ48pvb1LIp5fa+e0w++35yOYGIBPjFIvRgNLl KPo+a1rKkMyFwwns2ovW3m/yL9fP8mpdNCSteEHJgZHV6xAZeJQb3AqeMLXnvo2Blv e7LvRelv28ES+NKv3fTr9F5Q= Received: from content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (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) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 8A5C22D029E1; Thu, 10 Jul 2025 14:38:48 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:4902:0:7404:2:1025]) by content-filter.t4-02.sbone.de (content-filter.t4-02.sbone.de [IPv6:fde9:577b:c1a9:4902:0:7404:2:2742]) (amavisd-new, port 10024) with ESMTP id jDbTjSiDx1tw; Thu, 10 Jul 2025 14:38:47 +0000 (UTC) Received: from strong-iwl0.sbone.de (strong-iwl0.sbone.de [IPv6:fde9:577b:c1a9:4902:a66b:b6ff:fe40:39a9]) (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) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 5374C2D029D8; Thu, 10 Jul 2025 14:38:47 +0000 (UTC) Date: Thu, 10 Jul 2025 14:38:47 +0000 (UTC) From: "Bjoern A. Zeeb" To: Warner Losh cc: Konstantin Belousov , Zhenlei Huang , FreeBSD Current Subject: Re: sysctl to prevent reboot? In-Reply-To: Message-ID: <3os2rn9s-17sn-0568-6400-6po56nqnq72q@yvfgf.mnoonqbm.arg> References: <1B1CD603-065D-436F-97D9-DDF65AB7F115@FreeBSD.org> X-OpenPGP-Key-Id: 0x14003F198FEFA3E77207EE8D2B58B8F83CCF1842 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: multipart/mixed; boundary="1098556516-1181702811-1752158327=:4078" X-Rspamd-Queue-Id: 4bdHXV1nDdz4JmB 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:3320, ipnet:2003::/19, country:DE] This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1098556516-1181702811-1752158327=:4078 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8BIT On Thu, 10 Jul 2025, Warner Losh wrote: > On Thu, Jul 10, 2025, 8:30 AM 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=7fb88c20eccc3fd2118fda2ba58d7afe2b87f7e3 >> < >> 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 >> < >> 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. I don't use it either for the normal OS but it does something (extra bad) if I type it and am not at the loader prompt as I thought I was. > There have been other proposals that align reboot better with Linux's > behavior, then a special check isn't needed. There was a reason I originally thoguth it was a sysctl as that would prevent any applicant binary modifications and probably would even catch a signal to init but whatever it is or will be; catching reboot would be good as that is the bad command from the loader. "reset" thankfully doesn't do any bad ... Using alias feels too fragile to be honest. Anyway; I an help myself now at least; thanks! -- Bjoern A. Zeeb r15:7 --1098556516-1181702811-1752158327=:4078--