History log of /src/sbin/init/init.c (Results 1 – 25 of 498)
Revision Date Author Comments
# 779812d6 14-Sep-2025 Jilles Tjoelker <jilles@FreeBSD.org>

init: Use root's home directory in single-user mode

When starting single-user mode, use the home directory from user root as
current directory and for the HOME environment variable. If the
directory

init: Use root's home directory in single-user mode

When starting single-user mode, use the home directory from user root as
current directory and for the HOME environment variable. If the
directory does not exist, set HOME=/.

Also adjust /root/.profile to stop setting HOME, since it should always
have been set now.

This is intended to keep shell startup files working in single-user mode
after /.profile has been removed.

Reviewed by: emaste, ivy, kevans
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D52527

show more ...


# a123502e 22-Apr-2025 Brooks Davis <brooks@FreeBSD.org>

Search for mntopts.h globally, not locally

Change the include directives to use <mntopts.h> instead of "mntopts.h"
now that it's installed by libutil (the latter option was dubious
regardless since

Search for mntopts.h globally, not locally

Change the include directives to use <mntopts.h> instead of "mntopts.h"
now that it's installed by libutil (the latter option was dubious
regardless since a -I${SRCTOP}/sbin/mount was required anyway).

Reviewed by: olce, imp, dim, emaste
Differential Revision: https://reviews.freebsd.org/D49952

show more ...


# 0b8224d1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

Remove copyright strings ifdef'd out

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.

Remove copyright strings ifdef'd out

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

show more ...


# 51e16cb8 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

sbin: Remove ancient SCCS tags.

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

sbin: Remove ancient SCCS tags.

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

show more ...


# eba230af 25-Sep-2023 John Baldwin <jhb@FreeBSD.org>

Purge more stray embedded $FreeBSD$ strings

These do not use __FBSDID but instead use bare char arrays.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41957


# f3dba162 11-Oct-2022 Sebastien Bini <Sebastien.BINI@stormshield.eu>

init: allow to start script executions with sh -o verify

On systems where mac_veriexec is enforced, init should run its scripts in verified mode.
This relies on the verify shell option introduced by

init: allow to start script executions with sh -o verify

On systems where mac_veriexec is enforced, init should run its scripts in verified mode.
This relies on the verify shell option introduced by D30464. init will detect if the shell
is /bin/sh, and in which case, add the verify option to the argument vector.
The verify option propagates to all files sourced by the shell, ensuring a better
protection than if the script was tested against an open(O_VERIFY) before running it.
This security can be bypassed with the kenv which overloads the shell to use.
However we feel confident that on systems running with mac_veriexec, this kenv will be blocked somehow.
Also, the verify option has no effect on systems where mac_veriexec is not loaded nor enforced.

Differential revision: https://reviews.freebsd.org/D34622
Reviewed by: sjg, wma

show more ...


# 203f2c14 06-Sep-2022 Corvin Köhne <CorvinK@beckhoff.com>

init: fix shutdown race

When calling shutdown, shutdown sends a signal to init and exits. This
causes a race condition for the waitpid function. If the signal wins the
race, wpid will be set to -1 a

init: fix shutdown race

When calling shutdown, shutdown sends a signal to init and exits. This
causes a race condition for the waitpid function. If the signal wins the
race, wpid will be set to -1 and init calls death_single. If shutdown
wins the race, wpid will be set to the pid of the shutdown process and
the requested_transition will be ignored.

Reviewed by: imp
Differential Revision: https://reviews.freebsd.org/D36356
MFC after: 1 week
Sponsored by: Beckhoff Automation GmbH & Co. KG

show more ...


# de08b516 21-Feb-2022 Mitchell Horne <mhorne@FreeBSD.org>

init(8): use proper boolean type for globals

Now that stdbool.h is included, prefer this. No functional change
intended.


# 7b0a665d 22-Feb-2022 Mitchell Horne <mhorne@FreeBSD.org>

boottrace: annotate init and shutdown utilities

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:

boottrace: annotate init and shutdown utilities

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

show more ...


# 4d159769 20-Jul-2021 Kyle Evans <kevans@FreeBSD.org>

init: execute /etc/rc.final after all user processes have terminated

This can be useful for, e.g., unmounting filesystems that were needed
for shutdown.

Reviewed by: kib
Sponsored by: NetApp, Inc.

init: execute /etc/rc.final after all user processes have terminated

This can be useful for, e.g., unmounting filesystems that were needed
for shutdown.

Reviewed by: kib
Sponsored by: NetApp, Inc.
Sponsored by: Klara, Inc.
X-NetApp-PR: #63
Differential Revision: https://reviews.freebsd.org/D31230

show more ...


# 852f70b2 03-Mar-2021 Kyle Evans <kevans@FreeBSD.org>

init: use explicit_bzero() for clearing passwords

This is a nop in practice, because it cannot be proven that this
particular bzero() is not significant. Make it explicit anyways, rather
than relyi

init: use explicit_bzero() for clearing passwords

This is a nop in practice, because it cannot be proven that this
particular bzero() is not significant. Make it explicit anyways, rather
than relying on an implementation detail of how the password is
collected.

Discussed with: Andrew Gierth <andrew tao146 riddles org uk>

show more ...


# 804b4afb 26-Dec-2020 Xin LI <delphij@FreeBSD.org>

sbin/init: Reduce code duplication by using %m for error message
instead of passing %s with return value from strerror().

MFC after: 2 weeks


# a449e81e 02-Sep-2020 Brooks Davis <brooks@FreeBSD.org>

Remove risky compatability with old kernels

The badsys() handler for SIGSYS was added as a transtion aid for kernels
lacking sysctl() in 1993. It is unsafe and unsound so remove it rather
than runn

Remove risky compatability with old kernels

The badsys() handler for SIGSYS was added as a transtion aid for kernels
lacking sysctl() in 1993. It is unsafe and unsound so remove it rather
than running the risk of a privilege-dropping system call being silently
omitted.

This partially reverts SCCSID 6.12 (Berkeley) 03/03/93 "add code to
change the system security level".

Reviewed by: mckusick, imp, kevans
Obtained from: CheriBSD
MFC after: 1 week
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D26289

show more ...


# bc02c18c 07-Feb-2020 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r357408 through r357661.


# 21c1a93c 05-Feb-2020 Kyle Evans <kevans@FreeBSD.org>

init(8): set environment variables from the "daemon" class as well

Specifically, when running /etc/rc. This allows one to specify via
login.conf(5) an environment that should be used when running se

init(8): set environment variables from the "daemon" class as well

Specifically, when running /etc/rc. This allows one to specify via
login.conf(5) an environment that should be used when running services to
ease, e.g., setting up env vars for an HTTP proxy consistently across cron
and services alike.

Future changes will extend cron(8)/service(8) to use environment vars
pecified in login.conf(5) as well to promote a more cohesive experience.

This is a part of D21481.

Submitted by: Andrew Gierth <andrew_tao173.riddles.org.uk>

show more ...


# 73c6e0c3 17-Jan-2020 Warner Losh <imp@FreeBSD.org>

Small tweak to the default behavior of shutdown -c

'shutdown -c' is supposed to power cycle the system rather than doing a normal
reboot. However, when that fails, it halts the system. This is not q

Small tweak to the default behavior of shutdown -c

'shutdown -c' is supposed to power cycle the system rather than doing a normal
reboot. However, when that fails, it halts the system. This is not quite right
since the intent isn't to halt the system but to restart. Make the default init
behavior be to restart the system. The halt(8) interface can be used if you'd
like to powercycle or halt.

MFC After: 1 week
Differential Revision: https://reviews.freebsd.org/D23129

show more ...


# 415e34c4 29-Mar-2019 Alan Somers <asomers@FreeBSD.org>

MFHead@r345677


# 98b1cf29 26-Mar-2019 Ed Maste <emaste@FreeBSD.org>

init: pedantic correction to "can't exec" script warning

Direct /etc/rc exec was introduced in r337321, with a fallback to
passing it to sh if direct exec fails. "Can't exec" is slightly
misleading

init: pedantic correction to "can't exec" script warning

Direct /etc/rc exec was introduced in r337321, with a fallback to
passing it to sh if direct exec fails. "Can't exec" is slightly
misleading in this case (the script is still executed, just not
directly).

show more ...


# 3611ec60 18-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r337646 through r338014.


# f9c0a512 10-Aug-2018 Dimitry Andric <dim@FreeBSD.org>

Merge ^/head r337286 through r337585.


# 779812d6 14-Sep-2025 Jilles Tjoelker <jilles@FreeBSD.org>

init: Use root's home directory in single-user mode

When starting single-user mode, use the home directory from user root as
current directory and for the HOME environment variable. If the
directory

init: Use root's home directory in single-user mode

When starting single-user mode, use the home directory from user root as
current directory and for the HOME environment variable. If the
directory does not exist, set HOME=/.

Also adjust /root/.profile to stop setting HOME, since it should always
have been set now.

This is intended to keep shell startup files working in single-user mode
after /.profile has been removed.

Reviewed by: emaste, ivy, kevans
MFC after: 1 week
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D52527

show more ...


# a123502e 22-Apr-2025 Brooks Davis <brooks@FreeBSD.org>

Search for mntopts.h globally, not locally

Change the include directives to use <mntopts.h> instead of "mntopts.h"
now that it's installed by libutil (the latter option was dubious
regardless since

Search for mntopts.h globally, not locally

Change the include directives to use <mntopts.h> instead of "mntopts.h"
now that it's installed by libutil (the latter option was dubious
regardless since a -I${SRCTOP}/sbin/mount was required anyway).

Reviewed by: olce, imp, dim, emaste
Differential Revision: https://reviews.freebsd.org/D49952

show more ...


# 0b8224d1 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

Remove copyright strings ifdef'd out

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.

Remove copyright strings ifdef'd out

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

show more ...


# 51e16cb8 23-Nov-2023 Warner Losh <imp@FreeBSD.org>

sbin: Remove ancient SCCS tags.

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

sbin: Remove ancient SCCS tags.

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

show more ...


# eba230af 25-Sep-2023 John Baldwin <jhb@FreeBSD.org>

Purge more stray embedded $FreeBSD$ strings

These do not use __FBSDID but instead use bare char arrays.

Reviewed by: imp, emaste
Differential Revision: https://reviews.freebsd.org/D41957


12345678910>>...20