Project

General

Profile

Actions

Bug #57369

closed

cephadm: do not use "sudo" when checking host is reachable if user is root

Added by Adam King over 1 year ago. Updated over 1 year ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
% Done:

0%

Source:
Tags:
backport_processed
Backport:
quincy
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

For https://tracker.ceph.com/issues/55641 we made sure to not use sudo before all of our commands if the user is root. We also, to solve https://tracker.ceph.com/issues/51733, added a check that runs "sudo true" with a timeout first to make sure the host is online. The patch for the sudo issue missed this additional check command that we run. We now have

try:
            r = await conn.run('sudo true', check=True, timeout=5)
            r = await conn.run(cmd, input=stdin)

where the cmd str only includes sudo if the user is not root

sudo_prefix = "sudo " if self.mgr.ssh_user != 'root' else "" 
cmd = sudo_prefix + " ".join(quote(x) for x in cmd)

The additional "sudo true" should also only include sudo if user is not root.


Related issues 1 (0 open1 closed)

Copied to Orchestrator - Backport #57521: quincy: cephadm: do not use "sudo" when checking host is reachable if user is rootResolvedAdam KingActions
Actions #1

Updated by Adam King over 1 year ago

  • Project changed from Ceph to Orchestrator
  • Pull request ID set to 47898
Actions #2

Updated by Adam King over 1 year ago

  • Status changed from In Progress to Pending Backport
  • Backport set to quincy
Actions #3

Updated by Backport Bot over 1 year ago

  • Copied to Backport #57521: quincy: cephadm: do not use "sudo" when checking host is reachable if user is root added
Actions #4

Updated by Backport Bot over 1 year ago

  • Tags set to backport_processed
Actions #5

Updated by Adam King over 1 year ago

  • Status changed from Pending Backport to Resolved
Actions

Also available in: Atom PDF