From fe0c1ee64486588b36e8042d7b074e61bcf5b533 Mon Sep 17 00:00:00 2001 From: Pulkit Jalan Date: Tue, 3 May 2016 07:41:09 +0100 Subject: [PATCH 1/2] Fixing scheduler switch user with withoutOverlapping together not working --- src/Illuminate/Console/Scheduling/Event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index 8b54815891f..96648b38a3e 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -226,7 +226,7 @@ public function buildCommand() $command = $this->command.$redirect.$output.' 2>&1 &'; } - return $this->user ? 'sudo -u '.$this->user.' '.$command : $command; + return $this->user ? 'sudo -u '.$this->user.' -- sh -c \''.$command.'\'' : $command; } /** From a2195fd2628e865f1a0c1946a96cdc9fa89c442f Mon Sep 17 00:00:00 2001 From: Pulkit Jalan Date: Tue, 3 May 2016 10:31:26 +0100 Subject: [PATCH 2/2] exclude switching user for windows --- src/Illuminate/Console/Scheduling/Event.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Console/Scheduling/Event.php b/src/Illuminate/Console/Scheduling/Event.php index 96648b38a3e..6fee7edcfa3 100644 --- a/src/Illuminate/Console/Scheduling/Event.php +++ b/src/Illuminate/Console/Scheduling/Event.php @@ -226,7 +226,7 @@ public function buildCommand() $command = $this->command.$redirect.$output.' 2>&1 &'; } - return $this->user ? 'sudo -u '.$this->user.' -- sh -c \''.$command.'\'' : $command; + return $this->user && ! windows_os() ? 'sudo -u '.$this->user.' -- sh -c \''.$command.'\'' : $command; } /**