Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 2025 21:31:20 +0800
From:      Zhenlei Huang <zlei@FreeBSD.org>
To:        "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
Cc:        FreeBSD Current <current@freebsd.org>, Konstantin Belousov <kib@freebsd.org>
Subject:   Re: sysctl to prevent reboot?
Message-ID:  <1B1CD603-065D-436F-97D9-DDF65AB7F115@FreeBSD.org>
In-Reply-To: <o2o49n7o-793n-q70n-s017-5q9508r363q7@yvfgf.mnoonqbm.arg>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]


> On Jul 10, 2025, at 9:18 PM, Bjoern A. Zeeb <bzeeb-lists@lists.zabbadoz.net> wrote:
> 
> Hi,
> 
> I am not sure where but I thought I saw a change fly by which would
> prevent a shutdpwn -r /reboot (and possibly halt?) from being executed
> while a sysctl was set.
> 
> Does anyone have a reference or have I been dreaming?
> 
> I would find that very helpful for host systems running (multiple) bhyve
> instances.  Happened twice to me recently that I typed reboot in the wrong
> window and restarted my dev machine entirely rather than a guest.
> 
> /bz
> 
> -- 
> Bjoern A. Zeeb                                                     r15:7
> 


Hi Bjoern A,

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

Best regards,
Zhenlei


[-- Attachment #2 --]
<html><head><meta http-equiv="Content-Type" content="text/html; charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 10, 2025, at 9:18 PM, Bjoern A. Zeeb &lt;<a href="mailto:bzeeb-lists@lists.zabbadoz.net" class="">bzeeb-lists@lists.zabbadoz.net</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Hi,<br class=""><br class="">I am not sure where but I thought I saw a change fly by which would<br class="">prevent a shutdpwn -r /reboot (and possibly halt?) from being executed<br class="">while a sysctl was set.<br class=""><br class="">Does anyone have a reference or have I been dreaming?<br class=""><br class="">I would find that very helpful for host systems running (multiple) bhyve<br class="">instances. &nbsp;Happened twice to me recently that I typed reboot in the wrong<br class="">window and restarted my dev machine entirely rather than a guest.<br class=""><br class="">/bz<br class=""><br class="">-- <br class="">Bjoern A. Zeeb &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;r15:7<br class=""><br class=""></div></div></blockquote></div><div class=""><br class=""></div><div class="">Hi Bjoern A,</div><div class=""><br class=""></div><div class="">I believe Konstantin's work [1] and &nbsp;[2] are precisely what you need.</div><div class=""><br class=""></div><div class="">[1]&nbsp;<a href="https://cgit.freebsd.org/src/commit/?id=7fb88c20eccc3fd2118fda2ba58d7afe2b87f7e3" class="">https://cgit.freebsd.org/src/commit/?id=7fb88c20eccc3fd2118fda2ba58d7afe2b87f7e3</a>&nbsp; &nbsp;shutdown(8): refuse to run if /var/run/noshutdown is present</div><div class="">[2]&nbsp;<a href="https://cgit.freebsd.org/src/commit/?id=384d976725a5c29734a9227fcdb6ef0807485c91" class="">https://cgit.freebsd.org/src/commit/?id=384d976725a5c29734a9227fcdb6ef0807485c91</a>&nbsp;&nbsp;rc.d: Add precious_machine rc.conf knob to create /var/run/noshutdown</div><br class=""><div class="">
<div>Best regards,</div><div>Zhenlei</div>

</div>
<br class=""></body></html>
help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1B1CD603-065D-436F-97D9-DDF65AB7F115>