From nobody Tue Dec 9 05:47:45 2025 X-Original-To: dev-commits-src-main@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 4dQSYY3Lwmz6K2Kt for ; Tue, 09 Dec 2025 05:47:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dQSYY2jYkz465Q for ; Tue, 09 Dec 2025 05:47:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765259265; 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=YO0wBNZGwPdZX6SHJ3cvLMk74huh84LoziCI8tvZ/Is=; b=CSrFYWVR8AelD1Rn9vXTf7wnty2ShrEcW7fNDUwEaqZHIVBwhiiHB5HtDvKdwEziXqc6lI vB9iZlXUk0JWLzoMU+EbuBDHhJFcpWatUnKcAn4+HcdI7nXlnwsUK39PlTZvu74mK03sze 8I2SFtKxGYsFn3KHl5zVDmVl2Yf/+I+751psRBp3LUB338nL/xNXHv6ar6ZV+DAk8XWlL4 DDAVGyozJuSHLtmr/cpGgcI5jvNegBxgj7y8sEweic0MMmDBd+Koa2mZmDYQJYpHnpW342 1aq070WeGUz38pknW8KT5RRLNucJWeFQJ7sKp5Rvvaf/q4trresL/nIpvbSV5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765259265; 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=YO0wBNZGwPdZX6SHJ3cvLMk74huh84LoziCI8tvZ/Is=; b=P9o7By39GZd3piF8ooIPDkxkpjV++8iAvN80alsDHjNs4Yzi1paUx8c+rsKeK1cE5jpAFd EDjPVyfX9sJT5ZkMA545hBQdrTE5A5Iak+k+Tu5uWW7ReDV4g0eDZi/K4hEEjS79ON48F0 O5vF2gzIb9Z0+Ypj3q6Wu18sBZ9cgj7V33jLfQrPqtZkWQ4EgBtspEUKw67vKvqYp1056X fIdUjD4yVx08rUfTYLB/j17mhQT4vy5RHQ+0NkajKp3zIgE6gBZnsmy+oPAdc4x6OfUKcQ mi/NOTgRPkXnBp3EInfrEWgkAlTPMJa1nsjQ49s5LUFR4l8l4Bmcdu3VTCUT7w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765259265; a=rsa-sha256; cv=none; b=SglvgCLNbmiBsaybMzVmGR+4Y8i8OShw4yw5PPxOVBaEmCrNIyM3HIpyB5yX1QUrYnE3ag Rh3xTY/lLqKUbcst647UByjwEFFYf87SSb+rXZu8BIk6hZlN6Z2OWojLJp5J4kNlgjL7qs tNWP1t2MspWZCeb0HhFwYedwTZxAF+0uzU0gLcct8n5O0IZRz2z69310DX5wZhrDojg5EK YeHZCHHBtn+eYbmIpj488mcRr+5od/Sn2ohquUuX8G/PNilxxoauQdoAqgQvosN7z4oESy abuCQ8uRcR/r8uWoM31pWxnf9255LslUtk55R5W137s9mH/S1AtRRGoCyKoM4w== 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 4dQSYY2H9wzmFH for ; Tue, 09 Dec 2025 05:47:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id e793 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Tue, 09 Dec 2025 05:47:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Xin LI Subject: git: f9500e75791c - main - shutdown(8): Document additional formats supported by the code. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: f9500e75791cf793904c80ca4a52433afd585a23 Auto-Submitted: auto-generated Date: Tue, 09 Dec 2025 05:47:45 +0000 Message-Id: <6937b801.e793.1b8d6d17@gitrepo.freebsd.org> The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/src/commit/?id=f9500e75791cf793904c80ca4a52433afd585a23 commit f9500e75791cf793904c80ca4a52433afd585a23 Author: Xin LI AuthorDate: 2025-12-09 05:46:24 +0000 Commit: Xin LI CommitDate: 2025-12-09 05:46:24 +0000 shutdown(8): Document additional formats supported by the code. MFC after: 1 week --- 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 ,