Skip to content

Commit 779649f

Browse files
agent: Avoid sudo, renew certificates assuming root (apache#2697)
In some environments running the keystore cert renewal (as root user) over an already connected agent connection may cause exception such as: `sudo: sorry, you must have a tty to run sudo`. Since, all agents - KVM, CPVM and SSVM run as root user, we don't need to run the renewal scripts with sudo. Signed-off-by: Rohit Yadav <[email protected]>
1 parent 6025f25 commit 779649f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

agent/src/com/cloud/agent/Agent.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ public Answer setupAgentKeystore(final SetupKeyStoreCommand cmd) {
728728
_shell.setPersistentProperty(null, KeyStoreUtils.KS_PASSPHRASE_PROPERTY, storedPassword);
729729
}
730730

731-
Script script = new Script(true, _keystoreSetupPath, 60000, s_logger);
731+
Script script = new Script(_keystoreSetupPath, 60000, s_logger);
732732
script.add(agentFile.getAbsolutePath());
733733
script.add(keyStoreFile);
734734
script.add(storedPassword);
@@ -772,7 +772,7 @@ private Answer setupAgentCertificate(final SetupCertificateCommand cmd) {
772772
throw new CloudRuntimeException("Unable to save received agent client and ca certificates", e);
773773
}
774774

775-
Script script = new Script(true, _keystoreCertImportPath, 60000, s_logger);
775+
Script script = new Script(_keystoreCertImportPath, 60000, s_logger);
776776
script.add(agentFile.getAbsolutePath());
777777
script.add(keyStoreFile);
778778
script.add(KeyStoreUtils.AGENT_MODE);

0 commit comments

Comments
 (0)