FreeBSD src
Go to file
Jessica Clarke a45048565a bsdinstall: Fix race condition when shutting down after installation
Whilst reboot(8) will block whilst it runs, shutdown(8) does not,
daemonizing instead. This means that we must wait after running it,
otherwise we will exit and cause the system to attempt to go multi-user
in parallel with the shutdown daemon killing init. With the new
multi-console support in the installer, runconsoles will immediately
kill this daemon, racing with the daemon being able to signal init as
desired, and I have seen this race be lost in QEMU with a single CPU. In
the past this wasn't such an issue, since shutdown's daemon puts itself
in a new session group immediately after fork (and the parent doesn't
wait until that has happened, so whilst there's technically a race
condition in there where it could receive a SIGHUP from the death of the
parent's session leader, in practice this is very unlikely to be hit.
This means that the only consequence of this oversight before was that
you might get the beginnings of more console output on the way to
multi-user and thus the console would look a little confusing.

Reviewed by:	gjb
Fixes:		e4505364c0 ("release/rc.local: Provide option to shutdown after installation complete")
Fixes:		a09af1b7fd ("bsdinstall release: Start installer on multiple consoles")
Differential Revision:	https://reviews.freebsd.org/D36879
2022-10-06 20:04:04 +01:00
.cirrus-ci Cirrus-CI: add some timing info on pkg install failure 2021-08-04 15:02:00 -04:00
.github CI: revert --with-config=dist to hotfix Ubuntu 20.04 2022-09-14 16:26:57 -07:00
bin sh: when loading profile, skip obvious scratch files. 2022-10-03 14:35:51 +00:00
cddl dtrace: Add a "regs" variable 2022-10-04 13:05:54 -04:00
contrib Remove telnetd sources 2022-10-05 17:27:14 +01:00
crypto ssh-keysign: fix double free in error path 2022-10-04 16:34:37 -04:00
etc Put OPIE to rest. 2022-10-02 03:37:29 +02:00
gnu libdialog: Bump shared library version to 10. 2021-10-27 09:30:24 -07:00
include netlink: add headers installation 2022-10-01 16:31:58 +00:00
kerberos5 pkgbase: split kerberos binaries and libs 2022-08-03 11:02:28 +01:00
lib Add information on how to load gmirror on boot to auto activate mirrors 2022-10-05 16:44:31 +00:00
libexec Put OPIE to rest. 2022-10-02 03:37:29 +02:00
release bsdinstall release: Start installer on multiple consoles 2022-10-03 17:09:17 +01:00
rescue rescue: Link libzutil after libzfs. 2022-10-03 16:10:42 -07:00
sbin nvmecontrol: Apply cast 2022-10-06 11:58:16 -07:00
secure openssl: install pc files 2022-09-06 09:32:02 +02:00
share vmd: Bypass MSI/MSI-X remapping when possible. 2022-10-06 12:15:25 -04:00
stand libsa/netif.c: Replace #if with #ifdef 2022-09-29 12:52:02 +02:00
sys ioat: Add Ice Lake ID. 2022-10-06 14:44:10 -04:00
targets Put OPIE to rest. 2022-10-02 03:37:29 +02:00
tests test/sys/opencrypto: Fix NIST KAT parser iterator 2022-10-06 16:42:31 +02:00
tools git-arc: Fix handling of review title containing double quotes 2022-10-04 13:05:54 -04:00
usr.bin ldd: use direct exec mode unconditionally 2022-10-06 18:50:26 +03:00
usr.sbin bsdinstall: Fix race condition when shutting down after installation 2022-10-06 20:04:04 +01:00
.arcconfig arcanist: use FreeBSD/git project repository instead of FreeBSD/svn 2022-08-23 14:16:41 +00:00
.arclint arc lint: ignore /tests/ in chmod 2017-12-19 03:38:06 +00:00
.cirrus.yml Cirrus-CI: move QEMU pkg installation to test script 2022-09-07 13:32:12 -04:00
.clang-format clang-format: Add bitset loop macros 2021-09-21 12:08:01 -04:00
.gitattributes Add a basic clang-format configuration file 2019-06-07 15:23:52 +00:00
.gitignore gitignore: Ignore compile_commands.events.json 2022-05-30 10:43:25 -04:00
COPYRIGHT Welcome 2022, update copyrights. 2022-01-01 09:49:49 -07:00
LOCKS LOCKS: update current locks 2018-06-09 03:08:04 +00:00
MAINTAINERS Remove myself from bhyve maintenance; ENOTIME. 2021-11-19 07:09:30 +10:00
Makefile Makefile: replace mergemaster references with etcupdate 2022-10-06 20:19:16 +02:00
Makefile.inc1 Rename MACHINE_ABI and TARGET_ABI 2022-10-05 17:27:44 +01:00
Makefile.libcompat Install working pkgconfig .pc files for compat libraries 2022-08-11 23:18:34 +01:00
Makefile.sys.inc AUTO_OBJ: For all top-level targets enforce using an OBJDIR. 2017-12-05 21:29:47 +00:00
ObsoleteFiles.inc netinet6: retire ip6protosw.h 2022-10-03 20:53:04 -07:00
README.md README.md: update gnu directory description 2021-12-17 08:45:31 -05:00
RELNOTES Mention telnetd removal 2022-09-28 20:07:05 +01:00
UPDATING LinuxKPI: move pm_message_t from kernel.h to pm.h 2022-06-10 14:05:12 +00:00

FreeBSD Source:

This is the top level of the FreeBSD source directory.

FreeBSD is an operating system used to power modern servers, desktops, and embedded platforms. A large community has continually developed it for more than thirty years. Its advanced networking, security, and storage features have made FreeBSD the platform of choice for many of the busiest web sites and most pervasive embedded networking and storage devices.

For copyright information, please see the file COPYRIGHT in this directory. Additional copyright information also exists for some sources in this tree - please see the specific source directories for more information.

The Makefile in this directory supports a number of targets for building components (or all) of the FreeBSD source tree. See build(7), config(8), FreeBSD handbook on building userland, and Handbook for kernels for more information, including setting make(1) variables.

Source Roadmap:

Directory Description
bin System/user commands.
cddl Various commands and libraries under the Common Development and Distribution License.
contrib Packages contributed by 3rd parties.
crypto Cryptography stuff (see crypto/README).
etc Template files for /etc.
gnu Commands and libraries under the GNU General Public License (GPL) or Lesser General Public License (LGPL). Please see gnu/COPYING and gnu/COPYING.LIB for more information.
include System include files.
kerberos5 Kerberos5 (Heimdal) package.
lib System libraries.
libexec System daemons.
release Release building Makefile & associated tools.
rescue Build system for statically linked /rescue utilities.
sbin System commands.
secure Cryptographic libraries and commands.
share Shared resources.
stand Boot loader sources.
sys Kernel sources.
sys/arch/conf Kernel configuration files. GENERIC is the configuration used in release builds. NOTES contains documentation of all possible entries.
tests Regression tests which can be run by Kyua. See tests/README for additional information.
tools Utilities for regression testing and miscellaneous tasks.
usr.bin User commands.
usr.sbin System administration commands.

For information on synchronizing your source tree with one or more of the FreeBSD Project's development branches, please see FreeBSD Handbook.