summaryrefslogtreecommitdiffstats
path: root/sbin/reboot/reboot.c
Commit message (Collapse)AuthorAgeFilesLines
* MFC r299196:garga2016-05-171-2/+2
| | | | | | | | Add missing parameters -N and -l to reroot and halt usage() Approved by: bapt Sponsored by: Rubicon Communications (Netgate) Differential Revision: https://reviews.freebsd.org/D6173
* MFC r290548:trasz2016-01-121-1/+19
| | | | | | | | | | | | Userspace part of reroot support. This makes it possible to change the root filesystem without full reboot, using "reboot -r". This can be used to to eg. boot from a temporary md_image preloaded by loader(8), setup an iSCSI session, and continue booting from rootfs mounted over iSCSI. Relnotes: yes Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D3693
* MFC: r292266 & r292947smh2016-01-061-3/+9
| | | | | | Add flag to disable inital reboot(8) userland sync Sponsored by: Multiplay
* Let reboot(8) use getprogname() to compare the program name.ed2011-12-111-3/+3
| | | | | While there, mark the global variable dohalt static, as reboot(8) only consists of a single C file.
* Port the remaining apps in sbin/ to utmpx; only reboot(8).ed2010-01-131-2/+1
|
* Add forgotten `void' keyword. This function has no arguments.ed2009-12-291-1/+1
|
* Let init(8) and reboot(8) use utmpx to log wtmp entries.ed2009-12-051-2/+7
| | | | | | | | 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().
* More rational usage()des2009-11-101-3/+5
|
* Remove and unused variable.bz2009-01-311-2/+1
| | | | | Submitted by: Christoph Mallon christoph.mallon@gmx.de MFC after: 2 weeks
* Block a variety of signals which may afffect reboot(8), before killingbms2006-08-021-2/+15
| | | | | | | | | | 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
* Block SIGHUP before killing init(8), to avoid a race condition which maybms2006-08-021-3/+3
| | | | | | | | kill the current process and hang the system when attempting reboot. PR: bin/64664 Reviewed by: ssouhal, phk (historic) MFC after: 30 days
* Truncate nextboot.conf file on creation, so existing garbage will be removed.pjd2005-03-211-1/+2
| | | | | | Submitted by: Gary Allan <dragonfly@gallan.plus.com> Obtained from: DragonFlyBSD MFC after: 3 days
* Sync program's usage() with manpage's SYNOPSIS.ru2005-02-101-2/+2
|
* Code style tweaks: Use static and const where suitable.delphij2005-01-251-7/+6
|
* The kernel specified in main() of reboot(8) will be initializeddelphij2005-01-251-5/+4
| | | | | | | | | | | | | 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
* Remove advertising clause from University of California Regent's license,markm2004-04-091-4/+0
| | | | | | per letter dated July 22, 1999. Approved by: core, imp
* Use __FBSDID() to quiet GCC 3.3 warnings.obrien2003-05-031-4/+4
|
* When kill(-1) returns ESRCH, it could be because the current processrwatson2003-04-021-1/+1
| | | | | | 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).
* Set only the RB_POWEROFF flag (not the RB_HALT flag) whenthomas2002-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | '-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)
* Correct the file that reboot -k creates so that it works with the newgordon2002-05-281-0/+1
| | | | | | nextboot functionality. Reviewed by: jake (mentor)
* Rename the file used to specify the nextboot to make it clear that thiswes2002-04-261-1/+1
| | | | | | | is a loader configuration file and can be used for more than just a kernel name. Submitted by: Gordon Tetlow <gordont@gnf.org>
* Add a -k option to reboot to specify the kernel to boot next timewes2002-04-261-5/+20
| | | | | | | | | | | | | | | | 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
* Constify and set WARNS=2.dd2001-07-151-1/+2
| | | | Submitted by: Mike Barcroft <mike@q9media.com>
* Include missing header files which define functions for which gcc hasdd2001-06-241-0/+1
| | | | builtins (e.g., exit, strcmp).
* Remove the "undocumented" comment in re lflag.nik2001-05-241-1/+1
|
* Reboot(8) normally waits 5 seconds after sending SIGTERMs to alliedowse2001-03-201-10/+32
| | | | | | | | | | 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.
* Add a "-d" option which causes the system to generate a crash dump.jdp1999-11-211-2/+8
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Correct use of .Nm. Add rcsid. -Wall. Add -p flag in usage string (was missing).charnier1998-07-151-8/+11
|
* Remove lines inside #ifdef 0/#endif.charnier1997-06-301-32/+1
|
* Use err(3) instead of local copy.charnier1997-06-161-7/+13
|
* compare return value from getopt against -1 rather than EOF, per the finalimp1997-03-291-1/+1
| | | | posix standard on the topic.
* Add support to halt, to allow it to request that the power be turned offjulian1996-08-241-2/+6
| | | | (the RB_POWEROFF flag)
* Install aliases "fasthalt" and "fastboot" for halt and boot respectively.dg1994-08-211-1/+1
| | | | | This is for "backwards compatibility". Documented these aliases in the manual page.
* BSD 4.4 Lite sbin Sourcesrgrimes1994-05-261-0/+204
Note: XNSrouted and routed NOT imported here, they shall be imported with usr.sbin.
OpenPOWER on IntegriCloud