fix: add /usr/local/bin symlink for nacos-setup to persist across shell sessions - #34
Merged
qiacheng7 merged 1 commit intoMay 20, 2026
Conversation
…ll sessions When installed via `curl | sudo bash`, $HOME points to /root, causing nacos-setup to be installed under /root/.nacos/bin which is not in the regular user's PATH. Mirror the existing nacos-cli behavior by creating a symlink in /usr/local/bin when it is writable. Fixes: alibaba/nacos#15173 Signed-off-by: cxhello <caixiaohuichn@gmail.com>
cxhello
force-pushed
the
fix/nacos-setup-system-symlink
branch
from
May 19, 2026 05:20
0b51aad to
18ada86
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
curl | sudo bash,$HOMEpoints to/root, causing nacos-setup to be installed under/root/.nacos/binwhich is not in the regular user's PATH. This results innacos-setup: command not foundafter opening a new terminal.nacos-clibehavior (_nacos_try_link_nacos_cli_system_symlink) by creating a symlink in/usr/local/binwhen it is writable.uninstall_nacos_setup()to remove the symlink on uninstall.Fixes: alibaba/nacos#15173
Changes
_nacos_try_link_nacos_setup_system_symlink()function innacos-installer.shinstall_nacos_setup()/usr/local/bin/nacos-setupsymlink removal inuninstall_nacos_setup()Test plan
curl | sudo bashon Linux, verifynacos-setupis available in a new terminalnacos-installer.sh uninstallcleans up/usr/local/bin/nacos-setup/usr/local/binis writable)