Skip to content

fix: make startup script sh compatible#15178

Merged
KomachiSion merged 1 commit into
alibaba:developfrom
jay666mnj:fix-startup-sh-posix-compat
May 19, 2026
Merged

fix: make startup script sh compatible#15178
KomachiSion merged 1 commit into
alibaba:developfrom
jay666mnj:fix-startup-sh-posix-compat

Conversation

@jay666mnj

Copy link
Copy Markdown
Contributor

What is the purpose of the change

Fix startup.sh compatibility when users run it with sh bin/startup.sh on Ubuntu/Debian, where /bin/sh is usually dash.

Brief changelog

  • Replace bash-only [[ ... ]] conditionals with POSIX-compatible [ ... ]
  • Replace &> redirection with > /dev/null 2>&1
  • Replace read -p with printf + read

Verifying this change

  • rg -n "\[\[|\]\]|&>|read -p|==" distribution\bin\startup.sh
  • git diff --cached --check

Fixes #15171

@CLAassistant

CLAassistant commented May 19, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@github-actions

Copy link
Copy Markdown

Thanks for your this PR. 🙏
Please check again for your PR changes whether contains any usage/api/configuration change such as Add new API , Add new configuration, Change default value of configuration.
If so, please add or update documents(markdown type) in docs/next/ for repository nacos-group/nacos-group.github.io


感谢您提交的PR。 🙏
请再次查看您的PR内容,确认是否包含任何使用方式/API/配置参数的变更,如:新增API新增配置参数修改默认配置等操作。
如果是,请确保在提交之前,在仓库nacos-group/nacos-group.github.io中的docs/next/目录下添加或更新文档(markdown格式)。

@KomachiSion

Copy link
Copy Markdown
Collaborator
  1. 这样修改完,是不是bash和sh都可以使用了, 在多个系统下(linux,unix,ubuntu等)
  2. [ISSUE #15171] Re-exec startup scripts under bash when invoked via sh #15177 这个PR是不是可以回滚了

@jay666mnj

jay666mnj commented May 19, 2026 via email

Copy link
Copy Markdown
Contributor Author

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@KomachiSion
KomachiSion merged commit 31f8d72 into alibaba:develop May 19, 2026
7 checks passed
@KomachiSion

KomachiSion commented May 19, 2026

Copy link
Copy Markdown
Collaborator

@jay666mnj 可以再帮忙提交一个PR, 先移除 #15177 的内容

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] startup.sh fails on Ubuntu due to dash incompatibility with [[ syntax

4 participants