In openrc-run.sh there is a break inside a case statement. Previously, this break was enclosed by a for loop. But commit 5a95fe73 from #872 removed that for loop. (This commit is included in release 0.63.)
In POSIX, the behavior of break outside of a loop is unspecified. In practice, break is a no-op1. Shellcheck also documents this. Bash in non-POSIX mode (presumably?) emits a warning, which is how it caught my attention in the first place when I performed a system upgrade on Artix Linux (0.63 to 0.63.1):
(7/9) Reloading system bus configuration...
* No permission to apply cgroup settings
/usr/lib/openrc/sh/openrc-run.sh: line 313: break: only meaningful in a `for', `while', or `until' loop
* Reloading D-BUS messagebus config ... [ ok ]
(The permission error was likely triggered because of chroot.)
If the intent is to retain the original logic, then that intent is certainly not honored by the currently stray break, which is acting like a no-op than breaking out of the current case clause.
P.S. The cgroup refactor in #820 also has similar no-op breaks, though that is a draft and not an immediate problem upstream. :)
In openrc-run.sh there is a
breakinside acasestatement. Previously, thisbreakwas enclosed by aforloop. But commit 5a95fe73 from #872 removed thatforloop. (This commit is included in release 0.63.)In POSIX, the behavior of
breakoutside of a loop is unspecified. In practice,breakis a no-op1. Shellcheck also documents this. Bash in non-POSIX mode (presumably?) emits a warning, which is how it caught my attention in the first place when I performed a system upgrade on Artix Linux (0.63 to 0.63.1):(The permission error was likely triggered because of chroot.)
If the intent is to retain the original logic, then that intent is certainly not honored by the currently stray
break, which is acting like a no-op than breaking out of the currentcaseclause.P.S. The cgroup refactor in #820 also has similar no-op
breaks, though that is a draft and not an immediate problem upstream. :)Footnotes
Tested in all POSIX-compatible shells I could get my hands on: bash 5.3.9(1) with
--posix, dash 0.5.13.1, ksh 2020.0.0, busybox 1.36.1 sh. I'm (still) not sure which one OpenRC uses, but I hope that confirms it... ↩