From 8f3c723b0741245e92c1f363af38e1468024ec68 Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sun, 4 Aug 2024 20:53:09 +0100 Subject: [PATCH] systemd: get executable path properly was just evaluating os.Args[0], which incorrectly points to your current directory if jfa-go was in your PATH (i.e. you ran `jfa-go` not `/usr/bin/jfa-go`). Uses Go's os.Executable() now. Fixes #352. --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 8a139a4..b6bd54f 100644 --- a/main.go +++ b/main.go @@ -787,7 +787,7 @@ func main() { fmt.Printf(lm.FailedReading+"\n", SYSTEMD_SERVICE, err) os.Exit(1) } - absPath, err := filepath.Abs(os.Args[0]) + absPath, err := os.Executable() if err != nil { absPath = os.Args[0] }