Merge branch '2.2' into 2.3
This commit is contained in:
commit
3081bfbb1e
@ -50,9 +50,14 @@ module.exports = function() {
|
||||
|
||||
// No password given, ask it from the command line
|
||||
if (argv.p == '') {
|
||||
argv.p = readlineSync.question('Enter password: ', {
|
||||
hideEchoBack: true
|
||||
})
|
||||
if (process.stdin.isTTY) {
|
||||
argv.p = readlineSync.question('Enter password: ', {
|
||||
hideEchoBack: true
|
||||
})
|
||||
} else {
|
||||
var line = fs.readFileSync(0)
|
||||
argv.p = line.toString().trim()
|
||||
}
|
||||
}
|
||||
|
||||
// Split the hostnames, separated by commas
|
||||
|
@ -1139,15 +1139,13 @@ int Mariadb_nodes::truncate_mariadb_logs()
|
||||
int local_result = 0;
|
||||
for (int node = 0; node < N; node++)
|
||||
{
|
||||
char sys[1024];
|
||||
if (strcmp(IP[node], "127.0.0.1") != 0)
|
||||
{
|
||||
sprintf(sys,
|
||||
"ssh -i %s -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o LogLevel=quiet %s@%s 'sudo truncate /var/lib/mysql/*.err --size 0;sudo rm -f /etc/my.cnf.d/binlog_enc*\' &",
|
||||
sshkey[node],
|
||||
access_user[node],
|
||||
IP[node]);
|
||||
local_result += system(sys);
|
||||
local_result += ssh_node_f(node, true,
|
||||
"truncate -s 0 /var/lib/mysql/*.err;"
|
||||
"truncate -s 0 /var/log/syslog;"
|
||||
"truncate -s 0 /var/log/messages;"
|
||||
"rm -f /etc/my.cnf.d/binlog_enc*;");
|
||||
}
|
||||
}
|
||||
return local_result;
|
||||
|
Loading…
x
Reference in New Issue
Block a user