Skip to content

Commit

Permalink
Fix restarting nginx in wsl:create-sites
Browse files Browse the repository at this point in the history
nginx didn't allow to restart as the restart command was in a loop and resulted in

```
Feb 03 15:09:01 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Feb 03 15:09:01 systemd[1]: nginx.service: Start request repeated too quickly.
Feb 03 15:09:01 systemd[1]: nginx.service: Failed with result 'exit-code'.
```

So just restart once at the end :)
  • Loading branch information
MichaelBelgium committed Feb 3, 2024
1 parent 37c21e1 commit a533048
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/WslCreateSiteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,13 +117,14 @@ public function execute(InputInterface $input, OutputInterface $output)
if (! is_null($shell_output)) {
var_dump($shell_output);
}

// Restart nginx
$shell_output = shell_exec('sudo service nginx restart');
if (! is_null($shell_output)) {
var_dump($shell_output);
}
}

// Restart nginx
$shell_output = shell_exec('sudo service nginx restart');
if (! is_null($shell_output)) {
var_dump($shell_output);
}

$output->writeln('WSL sites have been created!');

return 0;
Expand Down

0 comments on commit a533048

Please sign in to comment.