summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWeidiDeng <weidi_deng@icloud.com>2024-08-13 10:26:20 +0800
committerGitHub <noreply@github.com>2024-08-12 20:26:20 -0600
commit9ddb78fadcdbec89a609127918604174121dcf42 (patch)
tree5e7ec2b45a973c727d46450a7002efeb8668d617
parent3a48b0336961e43e6f6f062bde7cecaa11043941 (diff)
cmd: ignore exec.ErrDot when starting caddy in background (#6512)
Co-authored-by: Mohammed Al Sahaf <msaa1990@gmail.com>
-rw-r--r--cmd/commandfuncs.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/commandfuncs.go b/cmd/commandfuncs.go
index 746cf3da..49d0321e 100644
--- a/cmd/commandfuncs.go
+++ b/cmd/commandfuncs.go
@@ -74,6 +74,10 @@ func cmdStart(fl Flags) (int, error) {
// sure by giving it some random bytes and having it echo
// them back to us)
cmd := exec.Command(os.Args[0], "run", "--pingback", ln.Addr().String())
+ // we should be able to run caddy in relative paths
+ if errors.Is(cmd.Err, exec.ErrDot) {
+ cmd.Err = nil
+ }
if configFlag != "" {
cmd.Args = append(cmd.Args, "--config", configFlag)
}