deployServer: проверка sudo -n только для systemctl сервиса
This commit is contained in:
parent
e921b06826
commit
ef0cd2cb7d
@ -43,11 +43,11 @@ public class IT_DeployRestartNoCleanNoTestsMain {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static void ensureSudoNoPasswordOrThrow() {
|
private static void ensureSudoNoPasswordOrThrow() {
|
||||||
int code = ssh("sudo -n true");
|
int code = ssh("sudo -n systemctl status " + SERVICE_NAME + " >/dev/null 2>&1");
|
||||||
if (code == 0) return;
|
if (code == 0) return;
|
||||||
throw new RuntimeException(
|
throw new RuntimeException(
|
||||||
"Remote sudo requires password for " + REMOTE_USER + "@" + REMOTE_HOST
|
"Remote sudo requires password for " + REMOTE_USER + "@" + REMOTE_HOST
|
||||||
+ ". Configure NOPASSWD for service control or run deploy with privileged user."
|
+ ". Configure NOPASSWD for 'systemctl ... " + SERVICE_NAME + "' or run deploy with privileged user."
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user