Skip to content

fix: add /usr/local/bin symlink for nacos-setup to persist across shell sessions - #34

Merged
qiacheng7 merged 1 commit into
nacos-group:mainfrom
cxhello:fix/nacos-setup-system-symlink
May 20, 2026
Merged

fix: add /usr/local/bin symlink for nacos-setup to persist across shell sessions#34
qiacheng7 merged 1 commit into
nacos-group:mainfrom
cxhello:fix/nacos-setup-system-symlink

Conversation

@cxhello

@cxhello cxhello commented May 19, 2026

Copy link
Copy Markdown
Member

Summary

  • 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. This results in nacos-setup: command not found after opening a new terminal.
  • Mirror the existing nacos-cli behavior (_nacos_try_link_nacos_cli_system_symlink) by creating a symlink in /usr/local/bin when it is writable.
  • Add corresponding cleanup logic in uninstall_nacos_setup() to remove the symlink on uninstall.

Fixes: alibaba/nacos#15173

Changes

  • Add _nacos_try_link_nacos_setup_system_symlink() function in nacos-installer.sh
  • Call it at the end of install_nacos_setup()
  • Add /usr/local/bin/nacos-setup symlink removal in uninstall_nacos_setup()

Test plan

  • All 94 existing tests pass
  • Install via curl | sudo bash on Linux, verify nacos-setup is available in a new terminal
  • Verify nacos-installer.sh uninstall cleans up /usr/local/bin/nacos-setup
  • Verify non-sudo install still works as before (symlink created only if /usr/local/bin is writable)

…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
cxhello force-pushed the fix/nacos-setup-system-symlink branch from 0b51aad to 18ada86 Compare May 19, 2026 05:20
@qiacheng7
qiacheng7 merged commit 08c723a into nacos-group:main May 20, 2026
5 checks passed
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] nacos-setup command disappears after Nacos process stops / shell session ends

2 participants