| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
LOG_CONS was OR'd into the facility argument instead of logopt, leaving
logopt as 0. The correct call is openlog(ident, LOG_CONS, LOG_AUTH),
as shutdown(8) and init(8) already do.
PR: 296315
Signed-off-by: Ricardo Branco <rbranco@suse.de>
Reviewed by: imp, des
Pull Request: https://github.com/freebsd/freebsd-src/pull/2300
|
| |
|
|
| |
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
|
| |
The RB_HALT bit is always set when invoked as `halt`, so to maintain a
distinction between `halt` and `halt -p`, we must check the RB_POWEROFF
bit first.
PR: 291814
Fixes: 4453ec5b8716 ("reboot: Default to a clean shutdown")
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D54320
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* If invoked as fasthalt or fastboot, behavior is unchanged.
* If not invoked as fasthalt or fastboot, we simply signal init(8),
just like shutdown(8) does, instead of taking the system down
ourselves.
* Since only init can handle the RB_REROOT case, the -r flag is not
supported in fast mode.
* Update the usage string to correctly reflect the program being run
(fast or normal; halt, boot, or nextboot) and the options available
in each case.
* Update the manual page to make the distinction between normal and
fast mode clear, better explain what shutdown(8) still does that
reboot(8) does not, and add a historical note explaining what the
difference between the two used to be.
MFC after: 1 month
Relnotes: yes
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D54117
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Reimplement the -a option which was available in the original shell
script and is still documented.
* Print the correct usage string when invoked as nextboot.
* Add the -D option to the manual page synopsis.
MFC after: 1 week
Fixes: fd6d47375a78 ("rescue,nextboot: Install nextboot as a link to reboot, rm nextboot.sh")
Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D54120
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
| |
PR: 259439
MFC after: 1 week
|
| |
|
|
|
|
| |
Reviewed by: imp
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D49704
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 is a residual of the $FreeBSD$ removal.
MFC After: 3 days (though I'll just run the command on the branches)
Sponsored by: Netflix
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
| |
Reviewed by: des, imp
Pull Request: https://github.com/freebsd/freebsd-src/pull/1077
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reboot now emulates the nextboot shell script completely. Retire the
nextboot.sh script and install the link. Retain the same manual page,
since there's enough differences between nextboot and reboot that
talking about nextboot would likely be confusing in nextboot.8
The nextboot.sh script no longer exists, so doesn't need to be fixed up
to create rescue. However, now we need a link from nextboot to reboot.
Sponsored by: Netflix
Reviewed by: kevans
Differential Revision: https://reviews.freebsd.org/D43831
Differential Revision: https://reviews.freebsd.org/D43843
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
9600 was a standard baud rate decades ago, but 115200 is now more common
so choose defaults that are useful to the largest number of users.
Note that boot0sio does not support rates above 9600 so it remains
unchanged.
Reviewed by: bz, imp, manu
Relnotes: Yes
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D36295
|
| |
|
|
| |
Remove /^\.\\"\s*\$FreeBSD\$$\n/
|
| |
|
|
| |
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
|
| |
|
|
| |
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
|
| |
|
|
| |
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
|
| |
|
|
|
|
|
|
|
| |
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.
Discussed with: pfg
MFC After: 3 days
Sponsored by: Netflix
|
| | |
|
| |
|
|
| |
MFC after: 1 week
|
| |
|
|
|
|
|
|
|
|
| |
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
|
| |
|
|
|
|
|
| |
Reported by: imp
Reviewed by: imp, tsoome
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D30650
|
| |
|
|
|
|
|
| |
MFC after: 3 days
Notes:
svn path=/head/; revision=367567
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the /boot/nextboot.conf file or its contents which is 1) not the most user-
friendly way of working with custom configurations, and 2) simply not true
for both Forth and Lua implementations: they would not delete it, but just
change the setting to "NO", that is, disable it.
While at it, add one missing serial (Oxford) comma and fix some bogus line
wraps along the way.
Approved by: bcr (manpages)
Differential Revision: https://reviews.freebsd.org/D25971
Notes:
svn path=/head/; revision=366626
|
| |
|
|
|
|
|
|
|
|
|
| |
Fix unquoted test for an empty value, which broke nextboot(8) on non-ZFS /boot
systems after r365938.
Discussed with: allanjude, tsoome
X-MFC-With: r365938
Notes:
svn path=/head/; revision=366078
|