From a575c653cf24936c53b065224f08f77ae368c621 Mon Sep 17 00:00:00 2001 From: "Zed A. Shaw" Date: Wed, 10 Sep 2025 14:21:27 -0400 Subject: [PATCH] Starting the README and realized .Name should be .URL. --- .ozai.json | 4 ++-- README.md | 9 +++++++++ config/settings.go | 2 +- main.go | 8 ++++---- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.ozai.json b/.ozai.json index a2b136d..611568d 100644 --- a/.ozai.json +++ b/.ozai.json @@ -1,12 +1,12 @@ { "Processes": { "tester1": { - "Name": "/tester1", + "URL": "/tester1", "Command": "tester", "Args": ["-count", "100", "-id", "1"] }, "tester2": { - "Name": "/tester2", + "URL": "/tester2", "Command": "tester", "Args": ["-count", "500", "-id", "2"] } diff --git a/README.md b/README.md index fd08e7b..e165cbf 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,12 @@ Ozai just does the minimal thing you want in a process watcher/restarter: No random ass Hugo includes. No forced upgrades to the latest possible Go. No randomly included entire web interfaces for no reason. Just the simplest thing needed for the task and no more. + + +## Getting Started + + +## Config File Format + + +## Restart HTTP URLs diff --git a/config/settings.go b/config/settings.go index 2933f89..138d633 100644 --- a/config/settings.go +++ b/config/settings.go @@ -12,7 +12,7 @@ import ( type Process struct { Command string Args []string - Name string + URL string Ready chan string ExecCmd *exec.Cmd } diff --git a/main.go b/main.go index fba9a97..58ba0b1 100644 --- a/main.go +++ b/main.go @@ -28,7 +28,7 @@ func LaunchProcess(proc *config.Process) { proc.ExecCmd.Err = nil } - fmt.Println("STARTING", proc.Name) + fmt.Println("STARTING", proc.URL) stderr, err := proc.ExecCmd.StderrPipe(); LaunchLogger(stderr, os.Stdout, err) @@ -37,12 +37,12 @@ func LaunchProcess(proc *config.Process) { LaunchLogger(stdout, os.Stdout, err) proc.ExecCmd.Start() - fmt.Println("WAITING for", proc.Name) + fmt.Println("WAITING for", proc.URL) fmt.Println("SENDING READY on channel") proc.Ready<- "ready" proc.ExecCmd.Wait() - fmt.Println("PROCESS", proc.Name, "EXITED") + fmt.Println("PROCESS", proc.URL, "EXITED") } } @@ -58,7 +58,7 @@ func main() { proc.Ready = make(chan string) go LaunchProcess(&proc) - http.HandleFunc(proc.Name, func(w http.ResponseWriter, r *http.Request) { + http.HandleFunc(proc.URL, func(w http.ResponseWriter, r *http.Request) { <-proc.Ready fmt.Println("!!!!!!!!!!!!!!!!!!! TIME TO DIE!!!!!") err := proc.ExecCmd.Process.Kill()