shell: add explicit bash() function

This commit is contained in:
Girish Ramakrishnan
2024-10-16 10:25:07 +02:00
parent d66db8ca40
commit df5ba25010
10 changed files with 46 additions and 63 deletions
+6 -6
View File
@@ -969,7 +969,7 @@ async function startTurn(existingInfra) {
await docker.deleteContainer('turn');
debug('startTurn: starting turn container');
await shell.exec(runCmd, { shell: '/bin/bash' });
await shell.bash(runCmd, {});
}
async function teardownTurn(app, options) {
@@ -1177,7 +1177,7 @@ async function startMysql(existingInfra) {
await docker.deleteContainer('mysql');
debug('startMysql: starting mysql container');
await shell.exec(runCmd, { shell: '/bin/bash' });
await shell.bash(runCmd, {});
if (!serviceConfig.recoveryMode) {
await waitForContainer('mysql', 'CLOUDRON_MYSQL_TOKEN');
@@ -1395,7 +1395,7 @@ async function startPostgresql(existingInfra) {
await docker.deleteContainer('postgresql');
debug('startPostgresql: starting postgresql container');
await shell.exec(runCmd, { shell: '/bin/bash' });
await shell.bash(runCmd, {});
if (!serviceConfig.recoveryMode) {
await waitForContainer('postgresql', 'CLOUDRON_POSTGRESQL_TOKEN');
@@ -1544,7 +1544,7 @@ async function startMongodb(existingInfra) {
}
debug('startMongodb: starting mongodb container');
await shell.exec(runCmd, { shell: '/bin/bash' });
await shell.bash(runCmd, {});
if (!serviceConfig.recoveryMode) {
await waitForContainer('mongodb', 'CLOUDRON_MONGODB_TOKEN');
@@ -1715,7 +1715,7 @@ async function startGraphite(existingInfra) {
if (upgrading) await shell.promises.sudo([ RMADDONDIR_CMD, 'graphite' ], {});
debug('startGraphite: starting graphite container');
await shell.exec(runCmd, { shell: '/bin/bash' });
await shell.bash(runCmd, {});
// restart collectd to get the disk stats after graphite starts. currently, there is no way to do graphite health check
setTimeout(async () => await safe(shell.promises.sudo([ RESTART_SERVICE_CMD, 'collectd' ], {})), 60000);
@@ -1860,7 +1860,7 @@ async function setupRedis(app, options) {
const [inspectError, result] = await safe(docker.inspect(redisName));
if (inspectError) {
await shell.exec(runCmd, { shell: '/bin/bash' });
await shell.bash(runCmd, {});
} else { // fast path
debug(`Re-using existing redis container with state: ${JSON.stringify(result.State)}`);
}