History log of /freebsd-10.1-release/sbin/reboot/reboot.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 272461 02-Oct-2014 gjb

Copy stable/10@r272459 to releng/10.1 as part of
the 10.1-RELEASE process.

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

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

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


# 228408 11-Dec-2011 ed

Let reboot(8) use getprogname() to compare the program name.

While there, mark the global variable dohalt static, as reboot(8) only
consists of a single C file.


# 202195 13-Jan-2010 ed

Port the remaining apps in sbin/ to utmpx; only reboot(8).


# 201182 29-Dec-2009 ed

Add forgotten `void' keyword. This function has no arguments.


# 200161 05-Dec-2009 ed

Let init(8) and reboot(8) use utmpx to log wtmp entries.

logwtmp() gets called with the raw strings that are written to disk. For
regular user entries, this isn't too bad, but when booting/shutting
down, the contents get rather cryptic.

Just call the standardized pututxline().


# 199130 10-Nov-2009 des

More rational usage()


# 187956 31-Jan-2009 bz

Remove and unused variable.

Submitted by: Christoph Mallon christoph.mallon@gmx.de
MFC after: 2 weeks


# 160916 02-Aug-2006 bms

Block a variety of signals which may afffect reboot(8), before killing
init(8), to avoid losing a race to them and dying before being able
to call reboot(2).

PR: bin/64664
Submitted by: maxim
Obtained from: NetBSD
MFC after: 30 days


# 160914 02-Aug-2006 bms

Block SIGHUP before killing init(8), to avoid a race condition which may
kill the current process and hang the system when attempting reboot.

PR: bin/64664
Reviewed by: ssouhal, phk (historic)
MFC after: 30 days


# 143948 21-Mar-2005 pjd

Truncate nextboot.conf file on creation, so existing garbage will be removed.

Submitted by: Gary Allan <dragonfly@gallan.plus.com>
Obtained from: DragonFlyBSD
MFC after: 3 days


# 141611 10-Feb-2005 ru

Sync program's usage() with manpage's SYNOPSIS.


# 140795 25-Jan-2005 delphij

Code style tweaks: Use static and const where suitable.


# 140794 25-Jan-2005 delphij

The kernel specified in main() of reboot(8) will be initialized
with -k option and never be used without kflag. This confuses
gcc because we set "kflag" at the same time with "kernel", but
the logic is not that apparant for gcc.

Since we can initialize "kernel" to NULL then know if "k" option
is set through determining whether it is still NULL, don't try
to have gcc to guess why we are connecting "kflag" with "kernel"
and use "kernel" directly in place of kflag.

Bump WARNS?= from 2 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


# 114589 03-May-2003 obrien

Use __FBSDID() to quiet GCC 3.3 warnings.


# 112991 02-Apr-2003 rwatson

When kill(-1) returns ESRCH, it could be because the current process
doesn't have a process group, which can occur if you're working with
a custom init that doesn't set up a full tty context. Rather than
refusing to reboot, ignore ESRCH from the kill attempt in reboot(8).


# 104572 06-Oct-2002 thomas

Set only the RB_POWEROFF flag (not the RB_HALT flag) when
'-p' is used on the reboot(8) command line.

This is intended for use when you want to attempt a power down
action, but you want the system to reboot (not halt) if the
power down action fails.

This is typically useful when the power-off action performed by
the kernel consists in signalling an uninterrupted power supply
that it should shut down its inverter if mains power has not returned.

The behaviour of shutdown(8) and init(8) is not modified;
only the behaviour of invoking 'reboot -p' manually is
modified, and then only in the case when a power-down action
fails.

Sounded reasonable to: phk
Approved by: roberto (mentor)


# 97428 28-May-2002 gordon

Correct the file that reboot -k creates so that it works with the new
nextboot functionality.

Reviewed by: jake (mentor)


# 95531 26-Apr-2002 wes

Rename the file used to specify the nextboot to make it clear that this
is a loader configuration file and can be used for more than just a
kernel name.

Submitted by: Gordon Tetlow <gordont@gnf.org>


# 95485 26-Apr-2002 wes

Add a -k option to reboot to specify the kernel to boot next time
around. If the kernel boots successfully, the record of this kernel
is erased, it is intended to be a one-shot option for testing
kernels.

This could be improved by having the loader remove the record of
the next kernel to boot, it is currently removed in /etc/rc immediately
after disks are mounted r/w.

I'd like to MFC this before the 4.6 freeze unless there is violent
objection.

Reviewed by: Several on IRC
MFC after: 4 days


# 79748 15-Jul-2001 dd

Constify and set WARNS=2.

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


# 78732 24-Jun-2001 dd

Include missing header files which define functions for which gcc has
builtins (e.g., exit, strcmp).


# 77122 24-May-2001 nik

Remove the "undocumented" comment in re lflag.


# 74525 20-Mar-2001 iedowse

Reboot(8) normally waits 5 seconds after sending SIGTERMs to all
processes and then sends SIGKILLs. If a lot of processes are swapped
out, this delay may not be long enough, so processes such as an X
server may be killed before they have had time to clean up properly.

Make this delay more dynamic by waiting up to 60 seconds for swap
page-in activity to end. While I'm here, ANSIfy and remove a
`register' specifier.


# 53523 21-Nov-1999 jdp

Add a "-d" option which causes the system to generate a crash dump.


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 37674 15-Jul-1998 charnier

Correct use of .Nm. Add rcsid. -Wall. Add -p flag in usage string (was missing).


# 27107 30-Jun-1997 charnier

Remove lines inside #ifdef 0/#endif.


# 26676 16-Jun-1997 charnier

Use err(3) instead of local copy.


# 24359 29-Mar-1997 imp

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


# 17801 23-Aug-1996 julian

Add support to halt, to allow it to request that the power be turned off
(the RB_POWEROFF flag)


# 2171 21-Aug-1994 dg

Install aliases "fasthalt" and "fastboot" for halt and boot respectively.
This is for "backwards compatibility". Documented these aliases in the
manual page.


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