When an absolute time is specified to shutdown, the program's behavior depends on whether that time has passed during the current calendar day. POLA would suggest that for shutdown, whose time argument is always supposed to be in the future, absolute times specified without a specific date should refer to the next occurrence of that time, rather than erroring out if that time has already passed during the current day. (We have a mechanism that automatically updates the kernel and schedules a reboot for 4 AM, which usually fails because we don't normally change kernels between midnight and 3. Fix: See the patch below for discussion. There are other bugs nearby in the code which this patch does not fix. (There is also a meta-bug, in that all the utilities which attempt to parse something vaguely ISO 8601-like should probably use a common parser rather than rolling their own.) How-To-Repeat: shutdown -r 0400
State Changed From-To: open->analyzed This change makes sense to me. If I would do something like that with absolute times I would mean the next occurence of that time. How about committing it Garrett?
A commit references this bug: Author: eadler Date: Mon Jan 1 22:33:58 UTC 2018 New revision: 327476 URL: https://svnweb.freebsd.org/changeset/base/327476 Log: shutdown: Assume absolute time is in the future The original bug describes it best: When an absolute time is specified to shutdown, the program's behavior depends on whether that time has passed during the current calendar day. POLA would suggest that for shutdown, whose time argument is always supposed to be in the future, absolute times specified without a specific date should refer to the next occurrence of that time, rather than erroring out if that time has already passed during the current day. PR: 32411 Submitted by: wollman@khavrinen.lcs.mit.edu Submitted on: 2001-11-30 20:30:01 UTC Reviewed by: asmodai (at time of bug submission) Changes: head/sbin/shutdown/shutdown.8 head/sbin/shutdown/shutdown.c
A commit references this bug: Author: eadler Date: Tue Jan 2 09:02:42 UTC 2018 New revision: 327488 URL: https://svnweb.freebsd.org/changeset/base/327488 Log: shutdown: Fix r327476 by adding init Initialize maybe_today. While here sort. PR: 32411 Additionally reported by: rgrimes, ian Changes: head/sbin/shutdown/shutdown.c