WsBX3FbUdGF6ONi60JdRFIQ9uPkVPHwnn5740K16+DCK3IUVVriVDu6PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765856905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tnE707a5ZSSvvWXJGns7XgcGTBLpcUh+acCc8oGbaq0=; b=UtKCpCjVjgJSqtdJHjklB8vG02a0N4ROvrEYKAiex1qhkX0WwXuUP8KCCCcLAAyssIRFiP Ynkefe3DXBfls+zWJQKJrsp5qQmvwBFhL2xre3Y7BgvjGjrqC+7ID3dBHUz1c2A0dEtmTN 1O2r7pBSj8vSWnLu4tzLlT/f0mP3plFukvWFxWY4gfrQFk2dV4IB+fSqRnpfr6U0T+4MTV 9keQKo7fOTGj0MdA3O5c5uV9qBCj1H/lGaLo68vfgVVanix83/qGMQScWjKigTRuQy8EeB lcOS0MEBiLIsxAtMTEHVAZNQhJO4MV/3mL04SwD96ERc/Xel2eyOA4HDyjYHjg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765856905; a=rsa-sha256; cv=none; b=bk8nU41ArfdCvCv+Ukf2Iv9g344GFDIav8MtJIXl04VP+XEZWma1HzVdtOZ3pXpMnvHGCj D7CljkEMN455SAMhh/4DuRjR1cQlnFVV3J4Iiq6ye1oVSXc5fDI7vPU+4cnBZC2fAGfi/B NnwjKp7Vfu3W67W9L4r1ez/cC5Gw7o3CzNosU3XUGMLKOdFRnVgNR+zmFJk2v8IH9eThEV otqjEFq+yS4fXmR0JHu24Mej2trp2OZz65p21dQSC9PTNvmWFaWMQFn4oW89f7nZXYz37W keESCSPvRbifO/zSqMoG1Vw/x8b5wl0YV1qp3UROos3VQZ/Q3C/TdDq1WDNYXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dVjZd0zPZzq1f for ; Tue, 16 Dec 2025 03:48:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 3b45a by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 16 Dec 2025 03:48:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Xin LI Subject: git: c13157b87b00 - stable/15 - shutdown(8): Document additional formats supported by the code. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: src X-Git-Refname: refs/heads/stable/15 X-Git-Reftype: branch X-Git-Commit: c13157b87b00e9a98c02b829c3658e46078db90b Auto-Submitted: auto-generated Date: Tue, 16 Dec 2025 03:48:25 +0000 Message-Id: <6940d689.3b45a.36037b75@gitrepo.freebsd.org> The branch stable/15 has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=c13157b87b00e9a98c02b829c3658e46078db90b commit c13157b87b00e9a98c02b829c3658e46078db90b Author: Xin LI AuthorDate: 2025-12-09 05:46:24 +0000 Commit: Xin LI CommitDate: 2025-12-16 03:46:52 +0000 shutdown(8): Document additional formats supported by the code. (cherry picked from commit f9500e75791cf793904c80ca4a52433afd585a23) --- sbin/shutdown/shutdown.8 | 62 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 47 insertions(+), 15 deletions(-) diff --git a/sbin/shutdown/shutdown.8 b/sbin/shutdown/shutdown.8 index ed44ac36aef6..2f09f5d524a9 100644 --- a/sbin/shutdown/shutdown.8 +++ b/sbin/shutdown/shutdown.8 @@ -25,7 +25,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd August 4, 2024 +.Dd December 8, 2025 .Dt SHUTDOWN 8 .Os .Sh NAME @@ -99,10 +99,10 @@ system multi-user with logins disabled (for all but super-user). If one of the .Fl c , .Fl h , -.Fl p +.Fl p , or .Fl r -options are specified, +options is specified, .Nm will execute .Xr halt 8 @@ -135,23 +135,42 @@ may be the case-insensitive word .Ar now (indicating an immediate shutdown) or a future time in one of two formats: -.Ar +number , -or -.Ar yymmddhhmm , -where the year, month, and day may be defaulted -to the current system values. +.Ar +number +or an absolute time specification. The first form brings the system down in .Ar number -minutes and the second at the absolute time specified. +time units (defaulting to minutes), and the second at the absolute time specified. +.Pp +An absolute time may be specified in one of the following formats, +where unspecified parts default to the current date: +.Bl -tag -width "YYMMDDhhmm" +.It Ar hhmm +Hour and minute. +.It Ar DDhhmm +Day, hour, and minute. +.It Ar MMDDhhmm +Month, day, hour, and minute. +.It Ar YYMMDDhhmm +Year (within the century), month, day, hour, and minute. +.El +.Pp +The year +.Ar YY +is interpreted relative to the current century, with a one-year tolerance +for values slightly in the past (to accommodate entry at year boundaries). .Ar +number may be specified in units other than minutes by appending the corresponding suffix: .Dq Li s , .Dq Li sec , +.Dq Li secs , .Dq Li m , .Dq Li min , +.Dq Li mins , .Dq Li h , -.Dq Li hour . +.Dq Li hour , +.Dq Li hours . +The unit suffixes are case-insensitive. .Pp If an absolute time is specified, but not a date, and that time today has already passed, @@ -174,7 +193,7 @@ At intervals, becoming more frequent as apocalypse approaches and starting at ten hours before shutdown, warning messages are displayed on the terminals of all users logged in. Five minutes before -shutdown, or immediately if shutdown is in less than 5 minutes, +shutdown, or immediately if shutdown is in less than five minutes, logins are disabled by creating .Pa /var/run/nologin and copying the @@ -192,7 +211,7 @@ At shutdown time a message is written to the system log, containing the time of shutdown, the person who initiated the shutdown and the reason. The corresponding signal is then sent to .Xr init 8 -to respectively halt, reboot or bring the system down to single-user state +to respectively halt, reboot, or bring the system down to single-user state (depending on the above options). The time of the shutdown and the warning message are placed in @@ -220,7 +239,7 @@ exits without executing any action on the system. .Pp When run without options, the .Nm -utility will place the system into single user mode at the +utility will place the system into single-user mode at the .Ar time specified. .Pp @@ -235,7 +254,7 @@ shutdown -p now .It Pa /var/run/nologin tells .Xr login 1 -not to let anyone log in +not to let anyone log in. .It Pa /var/run/noshutdown prevents .Nm @@ -249,9 +268,22 @@ Reboot the system in 30 minutes and display a warning message on the terminals of all users currently logged in: .Pp .Dl # shutdown -r +30 \&"System will reboot\&" +.Pp +Halt the system at 23:30 (using either format): +.Pp +.Dl # shutdown -h 2330 +.Dl # shutdown -h 23:30 +.Pp +Power off the system on June 15th at 10:00: +.Pp +.Dl # shutdown -p 06151000 .Sh COMPATIBILITY -The hours and minutes in the second time format may be separated by +The hours and minutes in any absolute time format may be separated by a colon (``:'') for backward compatibility. +For example, +.Ar hh:mm +is accepted as equivalent to +.Ar hhmm . .Sh SEE ALSO .Xr kill 1 , .Xr login 1 ,