Skip to content

Conversation

@lukebakken
Copy link
Collaborator

Commit 68c3055 removed the code that detected the -detached command-line argument and set the detached variable. However, the conditional check for $detached remained, along with a comment referencing "the code above" that no longer exists. This left orphaned code that could never execute its intended branch.

This change restores the argument detection loop that sets detached to "true" when -detached is found in the command-line arguments. The loop uses POSIX-compliant syntax to iterate through all positional parameters and check for the -detached flag.

Additionally, this change replaces the deprecated -o operator with || in the conditional test, following POSIX best practices for boolean OR operations in shell scripts.

@lukebakken lukebakken self-assigned this Nov 28, 2025
@lukebakken lukebakken force-pushed the lukebakken/rabbitmq-server-detached branch 2 times, most recently from 1f51f36 to 304ebf1 Compare November 28, 2025 22:28
Commit 68c3055 removed the code that
detected the `-detached` command-line argument and set the `detached`
variable. However, the conditional check for `$detached` remained, along
with a comment referencing "the code above" that no longer exists. This
left orphaned code that could never execute its intended branch.

This change restores the argument detection loop that sets `detached` to
`"true"` when `-detached` is found in the command-line arguments. The
loop uses POSIX-compliant syntax to iterate through all positional
parameters and check for the `-detached` flag.

Additionally, this change replaces the deprecated `-o` operator with
`||` in the conditional test, following POSIX best practices for boolean
OR operations in shell scripts.
@lukebakken lukebakken force-pushed the lukebakken/rabbitmq-server-detached branch from 304ebf1 to a48ea81 Compare November 28, 2025 22:29
@lukebakken lukebakken marked this pull request as ready for review November 28, 2025 22:29
@michaelklishin
Copy link
Collaborator

The context here is docker-library/rabbitmq#778 and rabbitmq/cluster-operator#2012.

@michaelklishin michaelklishin merged commit 8189125 into rabbitmq:main Nov 29, 2025
289 of 291 checks passed
michaelklishin added a commit that referenced this pull request Nov 29, 2025
Restore `-detached` argument detection in `rabbitmq-server` (backport #15036)
michaelklishin added a commit that referenced this pull request Nov 29, 2025
Restore `-detached` argument detection in `rabbitmq-server` (backport #15036) (backport #15037)
@lukebakken lukebakken deleted the lukebakken/rabbitmq-server-detached branch November 30, 2025 00:16
@lukebakken
Copy link
Collaborator Author

Thanks @michaelklishin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants