Add explicit user-service autostart configuration

This commit is contained in:
2026-10-08 23:22:51 +01:00
parent accbe63e39
commit 4697bb4465
10 changed files with 560 additions and 14 deletions
+8
View File
@@ -8,6 +8,7 @@ import (
"io"
"os"
"path/filepath"
"runtime"
"strings"
)
@@ -26,6 +27,13 @@ func Uninstall(executable string, args []string, in io.Reader, out io.Writer) er
if len(f.Args()) > 0 {
return fmt.Errorf("uninstall takes no positional arguments")
}
if path, err := serviceFile(runtime.GOOS); err == nil {
if _, err = os.Lstat(path); err == nil {
return fmt.Errorf("disable autostart with pipelines service disable before uninstalling (%s)", path)
} else if !os.IsNotExist(err) {
return err
}
}
resolved, err := filepath.EvalSymlinks(executable)
if err != nil {
return err