History log of /freebsd-11-stable/sbin/shutdown/shutdown.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 331722 29-Mar-2018 eadler

Revert r330897:

This was intended to be a non-functional change. It wasn't. The commit
message was thus wrong. In addition it broke arm, and merged crypto
related code.

Revert with prejudice.

This revert skips files touched in r316370 since that commit was since
MFCed. This revert also skips files that require $FreeBSD$ property
changes.

Thank you to those who helped me get out of this mess including but not
limited to gonzo, kevans, rgrimes.

Requested by: gjb (re)


# 330897 14-Mar-2018 eadler

Partial merge of the SPDX changes

These changes are incomplete but are making it difficult
to determine what other changes can/should be merged.

No objections from: pfg


# 302408 07-Jul-2016 gjb

Copy head@r302406 to stable/11 as part of the 11.0-RELEASE cycle.
Prune svn:mergeinfo from the new branch, as nothing has been merged
here.

Additional commits post-branch will follow.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


/freebsd-11-stable/MAINTAINERS
/freebsd-11-stable/cddl
/freebsd-11-stable/cddl/contrib/opensolaris
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/print
/freebsd-11-stable/cddl/contrib/opensolaris/cmd/zfs
/freebsd-11-stable/cddl/contrib/opensolaris/lib/libzfs
/freebsd-11-stable/contrib/amd
/freebsd-11-stable/contrib/apr
/freebsd-11-stable/contrib/apr-util
/freebsd-11-stable/contrib/atf
/freebsd-11-stable/contrib/binutils
/freebsd-11-stable/contrib/bmake
/freebsd-11-stable/contrib/byacc
/freebsd-11-stable/contrib/bzip2
/freebsd-11-stable/contrib/com_err
/freebsd-11-stable/contrib/compiler-rt
/freebsd-11-stable/contrib/dialog
/freebsd-11-stable/contrib/dma
/freebsd-11-stable/contrib/dtc
/freebsd-11-stable/contrib/ee
/freebsd-11-stable/contrib/elftoolchain
/freebsd-11-stable/contrib/elftoolchain/ar
/freebsd-11-stable/contrib/elftoolchain/brandelf
/freebsd-11-stable/contrib/elftoolchain/elfdump
/freebsd-11-stable/contrib/expat
/freebsd-11-stable/contrib/file
/freebsd-11-stable/contrib/gcc
/freebsd-11-stable/contrib/gcclibs/libgomp
/freebsd-11-stable/contrib/gdb
/freebsd-11-stable/contrib/gdtoa
/freebsd-11-stable/contrib/groff
/freebsd-11-stable/contrib/ipfilter
/freebsd-11-stable/contrib/ldns
/freebsd-11-stable/contrib/ldns-host
/freebsd-11-stable/contrib/less
/freebsd-11-stable/contrib/libarchive
/freebsd-11-stable/contrib/libarchive/cpio
/freebsd-11-stable/contrib/libarchive/libarchive
/freebsd-11-stable/contrib/libarchive/libarchive_fe
/freebsd-11-stable/contrib/libarchive/tar
/freebsd-11-stable/contrib/libc++
/freebsd-11-stable/contrib/libc-vis
/freebsd-11-stable/contrib/libcxxrt
/freebsd-11-stable/contrib/libexecinfo
/freebsd-11-stable/contrib/libpcap
/freebsd-11-stable/contrib/libstdc++
/freebsd-11-stable/contrib/libucl
/freebsd-11-stable/contrib/libxo
/freebsd-11-stable/contrib/llvm
/freebsd-11-stable/contrib/llvm/projects/libunwind
/freebsd-11-stable/contrib/llvm/tools/clang
/freebsd-11-stable/contrib/llvm/tools/lldb
/freebsd-11-stable/contrib/llvm/tools/llvm-dwarfdump
/freebsd-11-stable/contrib/llvm/tools/llvm-lto
/freebsd-11-stable/contrib/mdocml
/freebsd-11-stable/contrib/mtree
/freebsd-11-stable/contrib/ncurses
/freebsd-11-stable/contrib/netcat
/freebsd-11-stable/contrib/ntp
/freebsd-11-stable/contrib/nvi
/freebsd-11-stable/contrib/one-true-awk
/freebsd-11-stable/contrib/openbsm
/freebsd-11-stable/contrib/openpam
/freebsd-11-stable/contrib/openresolv
/freebsd-11-stable/contrib/pf
/freebsd-11-stable/contrib/sendmail
/freebsd-11-stable/contrib/serf
/freebsd-11-stable/contrib/sqlite3
/freebsd-11-stable/contrib/subversion
/freebsd-11-stable/contrib/tcpdump
/freebsd-11-stable/contrib/tcsh
/freebsd-11-stable/contrib/tnftp
/freebsd-11-stable/contrib/top
/freebsd-11-stable/contrib/top/install-sh
/freebsd-11-stable/contrib/tzcode/stdtime
/freebsd-11-stable/contrib/tzcode/zic
/freebsd-11-stable/contrib/tzdata
/freebsd-11-stable/contrib/unbound
/freebsd-11-stable/contrib/vis
/freebsd-11-stable/contrib/wpa
/freebsd-11-stable/contrib/xz
/freebsd-11-stable/crypto/heimdal
/freebsd-11-stable/crypto/openssh
/freebsd-11-stable/crypto/openssl
/freebsd-11-stable/gnu/lib
/freebsd-11-stable/gnu/usr.bin/binutils
/freebsd-11-stable/gnu/usr.bin/cc/cc_tools
/freebsd-11-stable/gnu/usr.bin/gdb
/freebsd-11-stable/lib/libc/locale/ascii.c
/freebsd-11-stable/sys/cddl/contrib/opensolaris
/freebsd-11-stable/sys/contrib/dev/acpica
/freebsd-11-stable/sys/contrib/ipfilter
/freebsd-11-stable/sys/contrib/libfdt
/freebsd-11-stable/sys/contrib/octeon-sdk
/freebsd-11-stable/sys/contrib/x86emu
/freebsd-11-stable/sys/contrib/xz-embedded
/freebsd-11-stable/usr.sbin/bhyve/atkbdc.h
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.c
/freebsd-11-stable/usr.sbin/bhyve/bhyvegc.h
/freebsd-11-stable/usr.sbin/bhyve/console.c
/freebsd-11-stable/usr.sbin/bhyve/console.h
/freebsd-11-stable/usr.sbin/bhyve/pci_fbuf.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.c
/freebsd-11-stable/usr.sbin/bhyve/pci_xhci.h
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.c
/freebsd-11-stable/usr.sbin/bhyve/ps2kbd.h
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.c
/freebsd-11-stable/usr.sbin/bhyve/ps2mouse.h
/freebsd-11-stable/usr.sbin/bhyve/rfb.c
/freebsd-11-stable/usr.sbin/bhyve/rfb.h
/freebsd-11-stable/usr.sbin/bhyve/sockstream.c
/freebsd-11-stable/usr.sbin/bhyve/sockstream.h
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.c
/freebsd-11-stable/usr.sbin/bhyve/usb_emul.h
/freebsd-11-stable/usr.sbin/bhyve/usb_mouse.c
/freebsd-11-stable/usr.sbin/bhyve/vga.c
/freebsd-11-stable/usr.sbin/bhyve/vga.h
# 275818 16-Dec-2014 gleb

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


# 238968 01-Aug-2012 des

Restore a piece of BSD history.

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


# 235855 23-May-2012 jilles

shutdown: Remove unnecessary 2-second delay.


# 229403 03-Jan-2012 ed

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.


# 227081 04-Nov-2011 ed

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.


# 216823 30-Dec-2010 pjd

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


# 201180 29-Dec-2009 ed

Add missing `void' for functions without arguments.

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


# 197560 28-Sep-2009 delphij

Static'ify internal methods and use prototype.


# 140797 25-Jan-2005 delphij

Use new style declarations instead of K&R ones.


# 140796 25-Jan-2005 delphij

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

Bump WARNS?= to 6


# 128073 09-Apr-2004 markm

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

Approved by: core, imp


# 114763 05-May-2003 obrien

Centralize _PATH_* definitions.

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


# 114589 03-May-2003 obrien

Use __FBSDID() to quiet GCC 3.3 warnings.


# 92883 21-Mar-2002 imp

o remove __P
o remove main prototype


# 79749 15-Jul-2001 dd

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

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


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 48956 21-Jul-1999 billf

Avoid ambigious if/else


# 48078 21-Jun-1999 ru

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


# 48062 21-Jun-1999 jkoshy

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.


# 48004 18-Jun-1999 ru

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


# 41684 11-Dec-1998 bde

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).


# 41683 11-Dec-1998 bde

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

Fixed some style bugs.


# 41666 10-Dec-1998 msmith

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


# 38036 03-Aug-1998 charnier

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


# 32399 10-Jan-1998 alex

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.


# 32344 08-Jan-1998 alex

Added environment parameter to execle calls.

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


# 32329 08-Jan-1998 alex

Correct a comment from my last commit.


# 32328 08-Jan-1998 alex

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.


# 28613 23-Aug-1997 joerg

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

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


# 26737 19-Jun-1997 charnier

Use err(3).


# 24359 29-Mar-1997 imp

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


# 21931 21-Jan-1997 adam

-n was broken

2.2 candidate (probably)


# 9987 07-Aug-1995 wollman

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


# 6443 15-Feb-1995 dg

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


# 4844 27-Nov-1994 ats

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


# 1559 26-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1558,
which included commits to RCS files with non-trunk default branches.


# 1558 26-May-1994 rgrimes

BSD 4.4 Lite sbin Sources

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