Skip to content

Commit 5329bcd

Browse files
committed
docs(README): Add configuration instructions for sudo password
- Include instructions for configuring sudo password to avoid errors when running soar commands. - Provide steps to edit the sudoers file for passwordless execution of soar commands on macOS. Signed-off-by: guanguans <[email protected]>
1 parent 94ee75b commit 5329bcd

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,10 +505,28 @@ array:9 [
505505
<details>
506506
<summary><b>:warning: When running in a unix OS non-cli environment, may throw `Fatal error: ...Exit Code: 2(Misuse of shell builtins)...`</b></summary>
507507

508+
### Configure sudo password
509+
508510
```php
509511
// Fatal error: Uncaught Symfony\Component\Process\Exception\ProcessFailedException: The command "'/Users/yaozm/Documents/develop/soar-php/bin/soar.darwin-arm64' '-report-type=json' '-query=SELECT * FROM `foo`;'" failed. Exit Code: 2(Misuse of shell builtins) Working directory: /Users/yaozm/Documents/develop/soar-php Output: ================ Error Output: ================ panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x104d22798] goroutine 1 [running]: github.com/pingcap/tidb/util/memory.MemTotalNormal() pkg/mod/github.com/pingcap/[email protected]/util/memory/meminfo.go:41 +0x68 github.com/pingcap/tidb/util/memory.init.0() pkg/mod/github.com/pingcap/[email protected]/util/memory/meminfo.go:134 +0x184 in /Users/yaozm/Documents/develop/soar-php/vendor/symfony/process/Process.php:273
510512
$soar->withSudoPassword('your sudo password'); // With a sudo password to run the soar command with sudo to avoid the above errors.
511513
```
514+
515+
### Or configure sudoers
516+
517+
> On higher versions of macOS, it is possible that the fingerprint authentication window will pop up. You can configure sudoers to run `soar` commands without a password.
518+
519+
1. Edit Configuration file of sudoers:
520+
521+
```shell
522+
sudo visudo
523+
```
524+
525+
2. Add rule [`{user name} ALL=(ALL) NOPASSWD: {soar binary(You can find it from the exception message.)}`]:
526+
527+
```shell
528+
guanguans ALL=(ALL) NOPASSWD: /Users/guanguans/Documents/develop/soar-php/bin/soar.darwin-arm64
529+
```
512530
</details>
513531

514532
## Composer scripts

0 commit comments

Comments
 (0)