Skip to content

Commit ec262b8

Browse files
author
Andreas Frömer
committed
Resolve issue with ProcessBuilder
Passing the process builder onto the unit and executing the command, was changing the binary of process which should not have happened
1 parent 00dcd2e commit ec262b8

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/SystemCtl.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,8 @@ public function getTimers(): array
126126
*/
127127
public function getProcessBuilder(): ProcessBuilder
128128
{
129-
$command = explode(' ', self::$binary);
130-
if (self::$sudo) {
131-
array_unshift($command, 'sudo');
132-
}
133-
134-
$builder = ProcessBuilder::create($command);
129+
$builder = ProcessBuilder::create();
130+
$builder->setPrefix(self::$binary);
135131
$builder->setTimeout(3);
136132

137133
return $builder;

0 commit comments

Comments
 (0)