opnsense-src/libexec/rc
Keve Müller 3c61bbebc4 Update rc.initdiskless, fix error handling of remount_optional
chkerr() ignores the exit code of a preceding mount command in case a
file ```remount_optional``` exists.  The check is performed and a
subshell is launched to log the informational message and return.  The
return is executed in the context of the subshell, not the context of
the chkerr() function, hence is a NOP.  The remount_optional check is
hence ineffective.

Change the code to if/then/fi, so the return is evaluated in the context
of the chkerr function, to make the check effective.

Reviewed by: imp, emaste
Pull Request: https://github.com/freebsd/freebsd-src/pull/1497
2025-01-24 12:40:33 -07:00
..
rc.d devmatch: do nothing if booted in safe mode 2024-12-13 22:31:38 -06:00
tests rc/tests: Skip oomprotect tests in a jail 2024-10-14 12:30:23 +02:00
debug.sh Update libexec/rc/debug.sh and hooks.sh 2024-12-31 10:47:06 -08:00
hooks.sh Update libexec/rc/debug.sh and hooks.sh 2024-12-31 10:47:06 -08:00
Makefile debug.sh take advantage of hooks.sh 2024-09-10 12:04:15 -07:00
netstart libexec: Remove ancient SCCS tags. 2023-11-26 22:23:28 -07:00
network.subr rc: network.subr update consitency with older change (v6/v4 order) 2024-09-05 19:53:57 +00:00
pccard_ether Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
rc Move fetch of DEBUG_SH from kenv to rc 2024-08-03 10:56:48 -07:00
rc.bsdextended Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
rc.conf rc: Document rtadvd_flags 2025-01-06 23:20:00 +00:00
rc.firewall Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
rc.initdiskless Update rc.initdiskless, fix error handling of remount_optional 2025-01-24 12:40:33 -07:00
rc.resume Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
rc.shutdown Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
rc.subr rc: Remove rc_fast_and_loose 2024-10-28 22:10:49 +01:00
rc.suspend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
safe_eval.sh safe_dot check file is a file 2024-08-16 13:15:20 -07:00