Skip to content

Conversation

@pangpang20
Copy link
Collaborator

Description

This pull request enhances the README.rst and tools/install_gaussdb_driver.sh to support non-root user installations of the GaussDB driver. The changes ensure that non-root users can install and configure the driver by leveraging user-level permissions, updating dynamic link library paths, and improving idempotency. The updates also improve documentation clarity and streamline the installation process for various supported systems (HCE, CentOS, Euler, Kylin).

Changes Made

  • README.rst:

    • Updated installation instructions to include steps for creating a non-root user (gaussdbUser) with sudo privileges.
    • Added commands to switch to the non-root user and source the installation script.
  • tools/install_gaussdb_driver.sh:

    • Removed dependency check for ldconfig to support non-root users.
    • Modified file copying and permission commands to avoid sudo where possible, enabling user-level operations.
    • Updated dynamic link library configuration to use user-level paths ($HOME_DIR/GaussDB_driver_lib) and append to ~/.bashrc.
    • Replaced system-wide /etc/ld.so.conf modifications with user-specific /etc/ld.so.conf.d/$(whoami).conf.
    • Added verification for libpq in the user’s library directory instead of system-wide ldconfig -p.
    • Added logic to reload ~/.bashrc when the script is sourced, with guidance for manual sourcing if not.
    • Improved logging for user-mode installation success and environment reload.

Testing

  • Tested the updated install_gaussdb_driver.sh script on EulerOS, CentOS, and Kylin systems as a non-root user with sudo privileges.
  • Verified that the driver installs correctly in $HOME_DIR/GaussDB_driver_lib and that LD_LIBRARY_PATH is updated in ~/.bashrc.
  • Confirmed that libpq is detected in the user’s library directory post-installation.
  • Validated that sourcing the script reloads the environment correctly and the driver is usable without manual intervention.
  • Ensured backward compatibility for root user installations by maintaining existing logic where applicable.

Additional Notes

  • The script now supports idempotent execution for both root and non-root users.
  • Users must have wheel group membership and sudo privileges for certain operations (e.g., ldconfig).
  • The updated README.rst provides clear instructions for setting up a non-root user, which should help new contributors.
  • Future improvements could include additional error handling for edge cases or support for more systems.

@5xuanwen 5xuanwen merged commit 36e8429 into HuaweiCloudDeveloper:master Oct 27, 2025
4 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.

2 participants