From dac694776d2c355ed2807830b7f49b342739aefa Mon Sep 17 00:00:00 2001 From: hanhh <18330117883@163.com> Date: Wed, 14 Jul 2021 15:13:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9spawn=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- back/services/cron.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/back/services/cron.ts b/back/services/cron.ts index fbccceaf..1676274b 100644 --- a/back/services/cron.ts +++ b/back/services/cron.ts @@ -211,7 +211,7 @@ export default class CronService { cmdStr = `${cmdStr} now`; } - const cp = spawn(cmdStr, { shell: true, detached: true }); + const cp = spawn(cmdStr, { shell: '/bin/bash' }); this.cronDb.update( { _id }, { $set: { status: CrontabStatus.running, pid: cp.pid } },