Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Jul 2025 08:32:51 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>, Zhenlei Huang <zlei@freebsd.org>,  FreeBSD Current <current@freebsd.org>
Subject:   Re: sysctl to prevent reboot?
Message-ID:  <CANCZdfrpX1B%2BY6RNijnqL1AD7w4wiuki8viMGDE50jjm-imR%2BQ@mail.gmail.com>
In-Reply-To: <aG_OeXOdKQ9uAt7m@kib.kiev.ua>
References:  <o2o49n7o-793n-q70n-s017-5q9508r363q7@yvfgf.mnoonqbm.arg> <1B1CD603-065D-436F-97D9-DDF65AB7F115@FreeBSD.org> <o0829s6o-7365-qn4n-8s39-0ro2r6173596@yvfgf.mnoonqbm.arg> <aG_OeXOdKQ9uAt7m@kib.kiev.ua>

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

[-- Attachment #1 --]
On Thu, Jul 10, 2025, 8:30 AM Konstantin Belousov <kostikbel@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  [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.
>

There have been other proposals that align reboot better with Linux's
behavior, then a special check isn't needed.

Warner

>

[-- Attachment #2 --]
<div dir="auto"><div><br><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Jul 10, 2025, 8:30 AM Konstantin Belousov &lt;<a href="mailto:kostikbel@gmail.com">kostikbel@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, Jul 10, 2025 at 01:51:47PM +0000, Bjoern A. Zeeb wrote:<br>
&gt; On Thu, 10 Jul 2025, Zhenlei Huang wrote:<br>
&gt; <br>
&gt; Hi,<br>
&gt; <br>
&gt; &gt; I believe Konstantin&#39;s work [1] and  [2] are precisely what you need.<br>
&gt; &gt; <br>
&gt; &gt; [1] <a href="https://cgit.freebsd.org/src/commit/?id=7fb88c20eccc3fd2118fda2ba58d7afe2b87f7e3" rel="noreferrer noreferrer" target="_blank">https://cgit.freebsd.org/src/commit/?id=7fb88c20eccc3fd2118fda2ba58d7afe2b87f7e3</a>; &lt;<a href="https://cgit.freebsd.org/src/commit/?id=7fb88c20eccc3fd2118fda2ba58d7afe2b87f7e3" rel="noreferrer noreferrer" target="_blank">https://cgit.freebsd.org/src/commit/?id=7fb88c20eccc3fd2118fda2ba58d7afe2b87f7e3</a>&gt;   shutdown(8): refuse to run if /var/run/noshutdown is present<br>
&gt; &gt; [2] <a href="https://cgit.freebsd.org/src/commit/?id=384d976725a5c29734a9227fcdb6ef0807485c91" rel="noreferrer noreferrer" target="_blank">https://cgit.freebsd.org/src/commit/?id=384d976725a5c29734a9227fcdb6ef0807485c91</a>; &lt;<a href="https://cgit.freebsd.org/src/commit/?id=384d976725a5c29734a9227fcdb6ef0807485c91" rel="noreferrer noreferrer" target="_blank">https://cgit.freebsd.org/src/commit/?id=384d976725a5c29734a9227fcdb6ef0807485c91</a>&gt;  rc.d: Add precious_machine rc.conf knob to create /var/run/noshutdown<br>
&gt; <br>
&gt; Thanks!  I was looking in the wrong place.<br>
&gt; <br>
&gt; That doesn&#39;t catch reboot, does it?  For me that&#39;s the offending command<br>
&gt; as I type that at the loader prompt (if I am in the correct window).<br>
<br>
Reboot is very different from shutdown.  I never use it except on nfs-booted<br>
crash boxes, so I did not considered.<br>
<br>
If you think it is useful, I can add the check there too.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">There have been other proposals that align reboot better with Linux&#39;s behavior, then a special check isn&#39;t needed.</div><div dir="auto"><br></div><div dir="auto">Warner</div><div dir="auto"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrpX1B%2BY6RNijnqL1AD7w4wiuki8viMGDE50jjm-imR%2BQ>