Made the service into a daemon that you can route IPC commands to

This commit is contained in:
2026-06-05 17:12:24 -05:00
parent 073db62fb1
commit 70483037c9
5 changed files with 280 additions and 65 deletions

View File

@@ -7,6 +7,7 @@ import (
"os"
"os/exec"
"path/filepath"
"strings"
"sync"
)
@@ -107,6 +108,10 @@ func (pm *ProcessManager) SendCommand(name string, command string) error {
return fmt.Errorf("Cannot send command, instance with name '%s' is not running", name)
}
if command != "" && !strings.HasPrefix(command, "/") {
command = "/" + command
}
_, err := io.WriteString(pipe, command+"\n")
if err != nil {
return fmt.Errorf("failed writing to server process stdin conduit: %w", err)