diff --git a/libexec/rc/rc b/libexec/rc/rc index db3c3e20ab4..75eef606b7f 100644 --- a/libexec/rc/rc +++ b/libexec/rc/rc @@ -46,6 +46,11 @@ HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin export HOME PATH +if ! [ -c /dev/null ]; then + echo "/dev is not populated" >&2 + exit 1 +fi + if [ "$1" = autoboot ]; then autoboot=yes _boot="faststart" diff --git a/share/man/man8/rc.8 b/share/man/man8/rc.8 index a68878f0a10..bfdd65b52f4 100644 --- a/share/man/man8/rc.8 +++ b/share/man/man8/rc.8 @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd September 20, 2024 +.Dd June 4, 2026 .Dt RC 8 .Os .Sh NAME @@ -97,6 +97,16 @@ command provides a scripting interface to modify system config files. .Ss Operation of Nm .Bl -enum .It +Verify that +.Pa /dev/null +exists and is a character device. +If that is not the case, +.Nm +prints an error message and terminates. +This is normally caused by forgetting to enable +.Xr devfs 5 +in a jail's configuration. +.It If autobooting, set .Va autoboot Ns = Ns Li yes and enable a flag