tiup icon indicating copy to clipboard operation
tiup copied to clipboard

tiup should not require sudo / su

Open dankasak opened this issue 2 years ago • 1 comments

Bug Report

Please answer these questions before submitting your issue. Thanks!

  1. What did you do? tiup cluster check ./topology.yaml

  2. What did you expect to see? Command succeeds

  3. What did you see instead? tiup is checking updates for component cluster ... Starting component cluster: /home/tiup/.tiup/components/cluster/v1.11.2/tiup-cluster check ./topology.yaml

  • Download necessary tools
    • Downloading check tools for linux/amd64 ... Done
  • Collect basic system information
    • Getting system info of 127.0.0.1:22 ... Error

Error: executor.ssh.execute_failed: Failed to execute command over SSH for '[email protected]:22' {ssh_stderr: We trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required , ssh_stdout: , ssh_command: export LANG=C; PATH=$PATH:/bin:/sbin:/usr/bin:/usr/sbin /usr/bin/sudo -H bash -c "test -d /tmp || (mkdir -p /tmp && chown tiup:$(id -g -n tiup) /tmp)"}, cause: Process exited with status 1

  1. What version of TiUP are you using (tiup --version)? 1.11.1 tiup Go Version: go1.19.2 Git Ref: v1.11.1 GitHash: b95172df211e4f9b643590f2dd8436ad60c72b38

Note:

  • systemd supports user services
  • Many organisations will not approve the use of "sudo" in a production environment. I've already encountered some during POCs ( as a TSA ), and seen yet more people discuss this in lark

dankasak avatar Feb 20 '23 01:02 dankasak

RHEL7 do not support systemd user services, maybe we could a option to use it

nexustar avatar Mar 20 '23 07:03 nexustar