execute services directly, not with a shell

This commit is contained in:
Florian Dold 2020-08-07 13:03:31 +05:30
parent 75b88c209e
commit 898de013e7
No known key found for this signature in database
GPG Key ID: D2E4F00F29D02A4B

View File

@ -280,10 +280,13 @@ export class GlobalTestState {
process.exit(1); process.exit(1);
} }
spawnService(command: string, logName: string): ProcessWrapper { spawnService(
console.log(`spawning process (${logName})`, command); command: string,
const proc = spawn(command, { args: string[],
shell: true, logName: string,
): ProcessWrapper {
console.log(`spawning process (${command})`);
const proc = spawn(command, args, {
stdio: ["inherit", "pipe", "pipe"], stdio: ["inherit", "pipe", "pipe"],
}); });
console.log(`spawned process (${logName}) with pid ${proc.pid}`); console.log(`spawned process (${logName}) with pid ${proc.pid}`);
@ -438,7 +441,8 @@ export class BankService {
async start(): Promise<void> { async start(): Promise<void> {
this.proc = this.globalTestState.spawnService( this.proc = this.globalTestState.spawnService(
`taler-bank-manage -c "${this.configFile}" serve-http`, "taler-bank-manage",
["-c", this.configFile, "serve-http"],
"bank", "bank",
); );
} }
@ -695,12 +699,14 @@ export class ExchangeService implements ExchangeServiceInterface {
await exec(`taler-exchange-keyup -c "${this.configFilename}"`); await exec(`taler-exchange-keyup -c "${this.configFilename}"`);
this.exchangeWirewatchProc = this.globalState.spawnService( this.exchangeWirewatchProc = this.globalState.spawnService(
`taler-exchange-wirewatch -c "${this.configFilename}"`, "taler-exchange-wirewatch",
["-c", this.configFilename],
`exchange-wirewatch-${this.name}`, `exchange-wirewatch-${this.name}`,
); );
this.exchangeHttpProc = this.globalState.spawnService( this.exchangeHttpProc = this.globalState.spawnService(
`taler-exchange-httpd -c "${this.configFilename}"`, "taler-exchange-httpd",
["-c", this.configFilename],
`exchange-httpd-${this.name}`, `exchange-httpd-${this.name}`,
); );
} }
@ -740,7 +746,8 @@ export class MerchantService {
await exec(`taler-merchant-dbinit -c "${this.configFilename}"`); await exec(`taler-merchant-dbinit -c "${this.configFilename}"`);
this.proc = this.globalState.spawnService( this.proc = this.globalState.spawnService(
`taler-merchant-httpd -LINFO -c "${this.configFilename}"`, "taler-merchant-httpd",
["-LINFO", "-c", this.configFilename],
`merchant-${this.merchantConfig.name}`, `merchant-${this.merchantConfig.name}`,
); );
} }