History log of /freebsd-current/sbin/shutdown/shutdown.c
Revision Date Author Comments
# 0b8224d1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

Remove copyright strings ifdef'd out

We've ifdef'd out the copyright strings for some time now. Go ahead and
remove the ifdefs. Plus whatever other detritis was left over from other
recent removals. These copyright strings are present in the comments and
are largely from CSRG's attempt at adding their copyright to every
binary file (which modern interpretations of the license doesn't
require).

Sponsored by: Netflix


# 51e16cb8 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

sbin: Remove ancient SCCS tags.

Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by: Netflix


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 7b0a665d 21-Feb-2022 Mitchell Horne <mhorne@FreeBSD.org>

boottrace: annotate init and shutdown utilities

Add boottrace annotations to record events in init(8), shutdown(8), and
reboot(8).

Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
X-NetApp-PR: #23
Differential Revision: https://reviews.freebsd.org/D31928


# 7d3df190 02-Jan-2018 Eitan Adler <eadler@FreeBSD.org>

shutdown: Fix r327476 by adding init

Initialize maybe_today. While here sort.

PR: 32411
Additionally reported by: rgrimes, ian


# cb1101af 01-Jan-2018 Eitan Adler <eadler@FreeBSD.org>

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)


# 8a16b7a1 20-Nov-2017 Pedro F. Giffuni <pfg@FreeBSD.org>

General further adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 3-Clause license.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

Special thanks to Wind River for providing access to "The Duke of
Highlander" tool: an older (2014) run over FreeBSD tree was useful as a
starting point.


# 25fd0815 30-Oct-2017 Warner Losh <imp@FreeBSD.org>

Add -c to the usage statements.

Submitted by: Maxim Konovalov


# e60baa72 25-Oct-2017 Warner Losh <imp@FreeBSD.org>

Add power cycle support (-c) to shutdown.

Sponsored by: Netflix


# fbbd9655 28-Feb-2017 Warner Losh <imp@FreeBSD.org>

Renumber copyright clause 4

Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by: Jan Schaumann <jschauma@stevens.edu>
Pull Request: https://github.com/freebsd/freebsd/pull/96


# c7d73a4d 16-Dec-2014 Gleb Kurtsou <gleb@FreeBSD.org>

sbin/shutdown: Support time units as in 'shutdown -r +5sec'

Units supported: s, sec, m, min, h, hour.

Differential Revision: https://reviews.freebsd.org/D1272


# 39faed57 01-Aug-2012 Dag-Erling Smørgrav <des@FreeBSD.org>

Restore a piece of BSD history.

PR: 169127
Submitted by: Ruben de Groot <ruben@hacktor.com>
MFC after: 1 week


# 23124c87 23-May-2012 Jilles Tjoelker <jilles@FreeBSD.org>

shutdown: Remove unnecessary 2-second delay.


# b3608ae1 03-Jan-2012 Ed Schouten <ed@FreeBSD.org>

Replace index() and rindex() calls with strchr() and strrchr().

The index() and rindex() functions were marked LEGACY in the 2001
revision of POSIX and were subsequently removed from the 2008 revision.
The strchr() and strrchr() functions are part of the C standard.

This makes the source code a lot more consistent, as most of these C
files also call into other str*() routines. In fact, about a dozen
already perform strchr() calls.


# 1efe3c6b 04-Nov-2011 Ed Schouten <ed@FreeBSD.org>

Add missing static keywords for global variables to tools in sbin/.

These tools declare global variables without using the static keyword,
even though their use is limited to a single C-file, or without placing
an extern declaration of them in the proper header file.


# 6868734c 30-Dec-2010 Pawel Jakub Dawidek <pjd@FreeBSD.org>

For compatibility with Linux and Solaris add poweroff(8).

It is implemented as a hard link to shutdown(8) and it is equivalent of:

# shutdown -p now

While I'm here put one line of usage into one line of C code so it is easier to
grep(1) and separate unrelated code with empty line.

MFC after: 2 weeks


# a7d5f7eb 19-Oct-2010 Jamie Gritton <jamie@FreeBSD.org>

A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.


# fe0506d7 09-Mar-2010 Marcel Moolenaar <marcel@FreeBSD.org>

Create the altix project branch. The altix project will add support
for the SGI Altix 350 to FreeBSD/ia64. The hardware used for porting
is a two-module system, consisting of a base compute module and a
CPU expansion module. SGI's NUMAFlex architecture can be an excellent
platform to test CPU affinity and NUMA-aware features in FreeBSD.


# 27d434af 29-Dec-2009 Ed Schouten <ed@FreeBSD.org>

Add missing `void' for functions without arguments.

While there, rename die_you_gravy_sucking_pig_dog() to something that's
less moronic.


# 9534110f 28-Sep-2009 Xin LI <delphij@FreeBSD.org>

Static'ify internal methods and use prototype.


# d7f03759 19-Oct-2008 Ulf Lilleengen <lulf@FreeBSD.org>

- Import the HEAD csup code which is the basis for the cvsmode work.


# f74b6bc2 25-Jan-2005 Xin LI <delphij@FreeBSD.org>

Use new style declarations instead of K&R ones.


# f906f843 25-Jan-2005 Xin LI <delphij@FreeBSD.org>

Use modern style defination for main() and move a extern
declaration to global section.

Bump WARNS?= to 6


# 4c723140 09-Apr-2004 Mark Murray <markm@FreeBSD.org>

Remove advertising clause from University of California Regent's license,
per letter dated July 22, 1999.

Approved by: core, imp


# 8d5c19ff 05-May-2003 David E. O'Brien <obrien@FreeBSD.org>

Centralize _PATH_* definitions.

Submitted by: Tim Kientzle <kientzle@acm.org> (embellished by me)


# c69284ca 03-May-2003 David E. O'Brien <obrien@FreeBSD.org>

Use __FBSDID() to quiet GCC 3.3 warnings.


# d476a036 21-Mar-2002 Warner Losh <imp@FreeBSD.org>

o remove __P
o remove main prototype


# 04983c4f 14-Jul-2001 Dima Dorfman <dd@FreeBSD.org>

Constify, de-register-ify, __unused-ify, and set WARNS=2.

Submitted by: Mike Barcroft <mike@q9media.com>


# 7f3dea24 27-Aug-1999 Peter Wemm <peter@FreeBSD.org>

$Id$ -> $FreeBSD$


# c1160fe4 20-Jul-1999 Bill Fumerola <billf@FreeBSD.org>

Avoid ambigious if/else


# 35cd460f 21-Jun-1999 Ruslan Ermilov <ru@FreeBSD.org>

Signal init(8) instead of executing halt(8) or reboot(8)
when halting or rebooting the system. It benefits from
running /etc/rc.shutdown by init(8).

``-o'' flag is provided for backward compatibility.

PR: 5451
Discussed with: des


# 1d4f4c0d 21-Jun-1999 Joseph Koshy <jkoshy@FreeBSD.org>

Minor cleanups to shutdown(8):

- Make the -k "don't actually halt" flag incompatible with
the halt/reboot options -h, -p, and -r.
- The -n "don't sync" option is ignored if -k is specified.
Issue a warning message.
- Compute the actual shutdown time written to /var/run/nologin
correctly in the case of "now" being specified.


# 966ea00a 18-Jun-1999 Ruslan Ermilov <ru@FreeBSD.org>

Fix a coredump with negative (due to overflow) offset values.


# 39b831af 11-Dec-1998 Bruce Evans <bde@FreeBSD.org>

Merged from Lite2 (one bcopy -> memmove, one significant change:
don't unlink _PATH_NOLOGIN for the -k case even if shutdown terminates
abnormally. NetBSD already has this change).


# 689419f3 11-Dec-1998 Bruce Evans <bde@FreeBSD.org>

Fixed missing 'p' and `-' flags and other defects in the usage message.

Fixed some style bugs.


# 7e2d04d7 10-Dec-1998 Mike Smith <msmith@FreeBSD.org>

Add a '-p' flag to shutdown which corresponds to the '-p' flag to halt,
requesting a system power-off after shutdown.


# d3714863 03-Aug-1998 Philippe Charnier <charnier@FreeBSD.org>

Correct use of .Nm. Add rcsid. Do not dot terminate err(3) strings. Spelling.


# f6faa785 10-Jan-1998 Alexander Langer <alex@FreeBSD.org>

Pass an actual empty environment to execle() as per POSIX rather than
rely on undocumented behavior.

The following fixes were obtained from OpenBSD:

o -Wall fixes to tlist array initialization and assignment used
as truth value.
o Use a restricted environment.
o Improved error message when shutdown fails to exec reboot or halt.


# 42f9a896 08-Jan-1998 Alexander Langer <alex@FreeBSD.org>

Added environment parameter to execle calls.

Obtained from: NetBSD PR2737 (augustss@cs.chalmers.se) via OpenBSD


# 74179785 07-Jan-1998 Alexander Langer <alex@FreeBSD.org>

Correct a comment from my last commit.


# 2dc34227 07-Jan-1998 Alexander Langer <alex@FreeBSD.org>

Allow 'shutdown datespec' to work into the next century. Handle dates
in the 22nd century and beyond even though it's irrelevant with a 32-bit
time_t which expires in the year 2038.


# 32c9dffb 23-Aug-1997 Joerg Wunsch <joerg@FreeBSD.org>

Make the daemon process a true daemon by calling setsid().

PR: bin/3202
Submitted by: Dmitrij Tejblum <dima@tejblum.dnttm.rssi.ru>


# 25e43cba 01-Jul-1997 Bruce Evans <bde@FreeBSD.org>

Import Lite2's src/sbin, except for XNSrouted and routed. All relevant
files in src/sbin are off the vendor branch, so this doesn't change the
active versions.


# a2bfcdfd 19-Jun-1997 Philippe Charnier <charnier@FreeBSD.org>

Use err(3).


# 8d64695c 28-Mar-1997 Warner Losh <imp@FreeBSD.org>

compare return value from getopt against -1 rather than EOF, per the final
posix standard on the topic.


# 3cf6d2e7 21-Jan-1997 Adam David <adam@FreeBSD.org>

-n was broken

2.2 candidate (probably)


# 656dcd43 07-Aug-1995 Garrett Wollman <wollman@FreeBSD.org>

Delete bogus referneces to timezone code internal header file `tzfile.h',
which is no longer bogusly installed in /usr/include.


# 32e68582 15-Feb-1995 David Greenman <dg@FreeBSD.org>

Yanked out (now obsolete) support for 'fastboot'.


# 7dd4667f 27-Nov-1994 Andreas Schulz <ats@FreeBSD.org>

Submitted by: M.C. Wong
Obtained from:
Don't throw away the /etc/nologin file in the -k case.


# 8fae3551 26-May-1994 Rodney W. Grimes <rgrimes@FreeBSD.org>

BSD 4.4 Lite sbin Sources

Note: XNSrouted and routed NOT imported here, they shall be imported with
usr.sbin.