| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
Similar to shutdown(8), refuse to reboot if /var/run/noshutdown is
present. The -f option can be used to force operation.
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D51241
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Read only filesystems always error when trying to remove something
with EROFS. However, that's true even if the file isn't there. The
code assumed it would always get a ENOENT if the file wasn't there,
but produced a gross message on read only systems. This message was
harmless, but annoying. Instead, stat the file first and return if
it's already not there.
Some readings of POSIX require that the ENOENT error take precidence
over the EROFS error. Linux made this change years ago, and we should
too. POSIX.1-2024 isn't explicit, but does say for unlink() does say
"[EROFS] The directory entry to be unlinked is part of a read-only file
system" and "[ENOENT] A component of path does not name an existing
file" implying that EROFS should only be returned for an existing
file. FreeBSD doesn't implement this, so this workaround is
necessary. Ideally, we'd fix this in the kernel in the future.
Sponsored by: Netflix
Discussed with: jrtc23
Differential Revision: https://reviews.freebsd.org/D48425
|
|
|
|
|
|
|
|
|
|
| |
This restores nextboot -k on ZFS setups where /boot is on the root
dataset of a pool.
Reviewed by: jrtc27, glebius
Fixes: 0c3ade2cf13d nextboot: fix nextboot -k on ZFS
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D45306
|
|
|
|
|
|
|
|
|
|
| |
As in the old nextboot.sh script:
- First write everything to a tempfile instead of /boot/nextboot.conf.
- fsync() the tempfile before renaming it to nextboot.conf.
Fixes: fd6d47375a78 ("rescue,nextboot: Install nextboot as a link to reboot, rm nextboot.sh")
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D44572
|
|
|
|
|
|
|
|
|
|
| |
Emulate rm -f from the nextboot.sh script: Report all errors, except
ENOENT. This problems show through, except the expected one when
nextboot.conf isn't there.
Sponsored by: Netflix
Reviewed by: rew
Differential Revision: https://reviews.freebsd.org/D44013
|
|
|
|
|
|
|
|
|
| |
It used to produce no output when the file couldn't be removed. Emulate
that better by unlinking and ignoring errors. It's used at the end of
reboot always, even when the file isn't going to be there.
Sponsored by: Netflix
Fixes: 2c479548119a
|
|
|
|
|
|
|
| |
zfsbootcfg(1) expects pool name to operate on, not currently mounted
filesystem name.
Fixes: fd6d47375a78fbf0737012b7cc11180291781e8b
|
|
|
|
| |
Fixes: fd6d47375a78fbf0737012b7cc11180291781e8b
|
|
|
|
|
|
|
|
| |
envorin isn't defined in any header, and gcc is cranky with this inside
a function, so move it to global scope. Both clang and gcc are now happy
with this.
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
|
|
|
| |
Use posix_spawn to avoid having to allocate memory needed for the system
command line.
Sponsored by: Netflix
Reviewed by: jrtc27
Differential Revision: https://reviews.freebsd.org/D43860
|
|
|
|
|
|
|
| |
Make static analyzers happy by initialzing howto to 0. Coverity is
cranky that it could be used unused. But it's analysis is incomplete
because the args to getopt when it wasn't initialized preclude it from
being used.
|
|
|
|
|
|
|
|
|
|
| |
Allow nextboot to be a symlink link to reboot. It does everything reboot
does, except doesn't actually setup the sytem to reboot and reboot. Also,
don't accept the reboot args related to rebooting when in nextboot mode.
Sponsored by: Netflix
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D43830
|
|
|
|
|
|
| |
Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D43829
|
|
|
|
|
|
|
|
|
| |
kernel isn't special, beyond the sanity checks we do. Add it to the env
rather than pass it into write_nextboot().
Sponsored by: Netflix
Reviewed by: kevans, kib
Differential Revision: https://reviews.freebsd.org/D43828
|
|
|
|
|
|
|
|
| |
Implement -e foo=bar to add loader environment variables to
nextboot.conf. bar is enclosed in quotes if it isn't already.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D43827
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement full support for ZFS -k support. For ZFS, we have to set a
property that gets cleared by the boot loaeder for whether or not to
process nextboot.conf. Do this using system("zfsbootcfg..." rather than
coding the small subset of that program inline to avoid CDDL
contamination of reboot and the complications of disabling CDDL and/or
ZFS. The few bytes needed to implement reboot for systems with zfs is
not worth saving for systems w/o ZFS.
Only set nextboot_enable=YES for UFS filesystems. They are the only one
that need that as the first line. Its presence on ZFS can cause the
kernel to not be oneshot.
Sponsored by: Netflix
Reviewed by: kevans, kib
Differential Revision: https://reviews.freebsd.org/D43824
|
|
|
|
|
|
|
|
| |
Implement -D from nextboot.sh which deletes the nextboot.conf file and
exists.
Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D43822
|
|
|
|
|
|
|
|
|
|
| |
Add sanity checking to the write to nextboot. Move to separate function
and allow force to override all errors. If we can't write nextboot.conf,
don't silently fail anymore.
Sponsored by: Netflix
Reviewed by: kevans, kib, markj, jhb
Differential Revision: https://reviews.freebsd.org/D43803
|
|
|
|
|
|
|
|
|
|
| |
reboot -k garbage won't boot garbage unless /boot/garbage/kernel is
there. Refuse to reboot if it is missing, though allow -f to force
it for special-use cases. This is in keeping with nextboot.sh.
Sponsored by: Netflix
Reviewed by: kevans, kib, markj, emaste
Differential Revision: https://reviews.freebsd.org/D43802
|
|
|
|
|
|
|
|
|
| |
Convert all the command line flags to bools, since that's how we use
them. Sort the includes while adding stdbool.h.
Sponsored by: Netflix
Reviewed by: kevans, kib, emaste
Differential Revision: https://reviews.freebsd.org/D43801
|
|
|
|
|
|
|
|
|
| |
When we're re-rooting to a new /, there is no next kernel. Error out
rather than leaving a timebomb in /boot/nextboot.conf.
Sponsored by: Netflix
Reviewed by: kevans, kib, emaste
Differential Revision: https://reviews.freebsd.org/D43800
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Noted by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42561
|
|
|
|
|
|
|
|
|
|
| |
Otherwise reboot(8) requires COMPAT_FREEBSD11 kernel config option.
PR: 275048
Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D42561
|
|
|
|
| |
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
|
|
|
|
|
|
|
|
| |
In most cases, usage does not return, so mark them as __dead2. For the
cases where they do return, they have not been marked __dead2.
Reviewed by: imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/735
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
fasthalt has behaved like reboot, instead of like halt, since r228408
(2011, 10.0-RELEASE). Fix it. One wonders if anyone will notice.
Approved by: re (kib)
MFC after: 3 days
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=338688
|
|
|
|
|
|
|
|
|
| |
preventing mistakes such as "halt 0p" for "halt -p".
Approved by: bde (mentor), phk (mentor)
MFC after: 1 week
Notes:
svn path=/head/; revision=332075
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Notes:
svn path=/head/; revision=326025
|
|
|
|
|
|
|
| |
Submitted by: Maxim Konovalov
Notes:
svn path=/head/; revision=325206
|
|
|
|
|
|
|
|
|
|
|
| |
When -c is specified, the system will be power cycled if the
underlying hardware supports it. Otherwise the system will be halted
or rebooted depending on which command was used.
Sponsored by: Netflix
Notes:
svn path=/head/; revision=324986
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=314436
|
|
|
|
|
|
|
|
|
| |
Approved by: bapt
Sponsored by: Rubicon Communications (Netgate)
Differential Revision: https://reviews.freebsd.org/D6173
Notes:
svn path=/head/; revision=299196
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Initialise Nflag to 0 preventing use of uninitialised value.
Reported by: uqs
MFC after: 1 week
X-MFC-With: r292266
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D4449
Notes:
svn path=/head/; revision=292947
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add -N flag to reboot(8) which bypasses the userland sync(2) during
reboot(8) while still allow the kernel sync during the reboot(2) syscall
to occur.
An example use of this is when rebooting with disconnected iSCSI sessions
which would otherwise cause the reboot to hang on BIOs that will never
complete.
Reviewed by: bjk
MFC after: 2 weeks
Sponsored by: Multiplay
Differential Revision: https://reviews.freebsd.org/D4449
Notes:
svn path=/head/; revision=292266
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
Reviewed by: kib@, bapt@
MFC after: 1 month
Relnotes: yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D3693
Notes:
svn path=/head/; revision=290548
|
|
|
|
|
|
|
|
| |
While there, mark the global variable dohalt static, as reboot(8) only
consists of a single C file.
Notes:
svn path=/head/; revision=228408
|
|
|
|
| |
Notes:
svn path=/head/; revision=202195
|
|
|
|
| |
Notes:
svn path=/head/; revision=201182
|
|
|
|
|
|
|
|
|
|
|
| |
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().
Notes:
svn path=/head/; revision=200161
|
|
|
|
| |
Notes:
svn path=/head/; revision=199130
|
|
|
|
|
|
|
|
| |
Submitted by: Christoph Mallon christoph.mallon@gmx.de
MFC after: 2 weeks
Notes:
svn path=/head/; revision=187956
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
Notes:
svn path=/head/; revision=160916
|
|
|
|
|
|
|
|
|
|
|
| |
kill the current process and hang the system when attempting reboot.
PR: bin/64664
Reviewed by: ssouhal, phk (historic)
MFC after: 30 days
Notes:
svn path=/head/; revision=160914
|
|
|
|
|
|
|
|
|
| |
Submitted by: Gary Allan <dragonfly@gallan.plus.com>
Obtained from: DragonFlyBSD
MFC after: 3 days
Notes:
svn path=/head/; revision=143948
|
|
|
|
| |
Notes:
svn path=/head/; revision=141611
|
|
|
|
| |
Notes:
svn path=/head/; revision=140795
|