Cleanup before merging to main

This commit is contained in:
2026-06-10 10:55:59 -05:00
parent c52e505c18
commit 61934bb2f4
3 changed files with 13 additions and 14 deletions

View File

@@ -98,14 +98,12 @@ func patchBinaryForNixos(binaryPath string) error {
return nil return nil
} }
fmt.Println("[NixOS Detected] Patching server interpreter pathway...") fmt.Println("[NixOS Detected] Patching server binary...")
dotnetRoot := os.Getenv("DOTNET_ROOT") dotnetRoot := os.Getenv("DOTNET_ROOT")
var interpreter string var interpreter string
if dotnetRoot != "" { if dotnetRoot != "" {
// Use the glibc version that matches the active .NET runtime exactly
// Finds the underlying ld-linux-x86-64.so.2 link within the .NET store closure
out, err := exec.Command("patchelf", "--print-interpreter", filepath.Join(dotnetRoot, "dotnet")).Output() out, err := exec.Command("patchelf", "--print-interpreter", filepath.Join(dotnetRoot, "dotnet")).Output()
if err == nil && len(out) > 0 { if err == nil && len(out) > 0 {
interpreter = strings.TrimSpace(string(out)) interpreter = strings.TrimSpace(string(out))

View File

@@ -30,7 +30,7 @@ func CreateNewInstance(name string, version string, meta InstanceMetadata, cfg *
instanceConfigPath := filepath.Join(instanceDir, "serverconfig.json") instanceConfigPath := filepath.Join(instanceDir, "serverconfig.json")
if err := PrepareInstanceConfig(version, instanceConfigPath, meta, cfg); err != nil { if err := PrepareInstanceConfig(version, instanceConfigPath, meta, cfg); err != nil {
return fmt.Errorf("Failed provisioning server baseline configuration: %w", err) return fmt.Errorf("Failed to create baseline configuration: %w", err)
} }
fmt.Printf("Instance '%s' (v%s) successfully initialized\n", name, version) fmt.Printf("Instance '%s' (v%s) successfully initialized\n", name, version)

21
main.go
View File

@@ -71,7 +71,7 @@ func main() {
switch subCommand { switch subCommand {
case "daemon": case "daemon":
fmt.Printf("Initializing VS server manager background supervisor [Config: %s]...\n", absConfigPath) fmt.Printf("Initializing VSSM Daemon [Config: %s]...\n", absConfigPath)
if err := StartDaemon(cfg, absConfigPath); err != nil { if err := StartDaemon(cfg, absConfigPath); err != nil {
log.Fatalf("Daemon runtime fatal error: %v", err) log.Fatalf("Daemon runtime fatal error: %v", err)
} }
@@ -149,7 +149,7 @@ func sendIPCRequest(cfg *AppConfig, method string, path string, body io.Reader)
fmt.Printf("Listen Addr: %s; Target URL: %s\n", listenAddress, targetUrl) fmt.Printf("Listen Addr: %s; Target URL: %s\n", listenAddress, targetUrl)
req, err := http.NewRequest(method, targetUrl, body) req, err := http.NewRequest(method, targetUrl, body)
if err != nil { if err != nil {
log.Fatalf("Failed to construct IPC frame: %v", err) log.Fatalf("Failed to construct IPC request: %v", err)
} }
if body != nil { if body != nil {
@@ -158,7 +158,7 @@ func sendIPCRequest(cfg *AppConfig, method string, path string, body io.Reader)
resp, err := http.DefaultClient.Do(req) resp, err := http.DefaultClient.Do(req)
if err != nil { if err != nil {
log.Fatalf("IPC connection failed. Is the vs-manager daemon running? Error: %v", err) log.Fatalf("IPC connection failed. Is the VSSM daemon running? Error: %v", err)
} }
defer resp.Body.Close() defer resp.Body.Close()
@@ -176,7 +176,7 @@ func fetchAndPrintStatus(cfg *AppConfig) {
targetUrl := fmt.Sprintf("http://%s/instances/list", listenAddress) targetUrl := fmt.Sprintf("http://%s/instances/list", listenAddress)
resp, err := http.Get(targetUrl) resp, err := http.Get(targetUrl)
if err != nil { if err != nil {
log.Fatalf("IPC connection failed. Is the vs-manager daemon running? Error: %v", err) log.Fatalf("IPC connection failed. Is the VSSM daemon running? Error: %v", err)
} }
defer resp.Body.Close() defer resp.Body.Close()
@@ -191,7 +191,7 @@ func fetchAndPrintStatus(cfg *AppConfig) {
} }
if len(instances) == 0 { if len(instances) == 0 {
fmt.Println("No instances configured yet. Use 'create' to provision one.") fmt.Println("No instances configured yet. Use 'create' to create one.")
return return
} }
@@ -210,10 +210,11 @@ func printUsage() {
fmt.Println("\nGlobal Options:") fmt.Println("\nGlobal Options:")
fmt.Println(" --config <path> Explicitly target a non-default config structure file location") fmt.Println(" --config <path> Explicitly target a non-default config structure file location")
fmt.Println("\nUsage Commands:") fmt.Println("\nUsage Commands:")
fmt.Println(" vssm daemon Starts the background process supervisor") fmt.Println(" vssm daemon Starts the daemon")
fmt.Println(" vssm create <name> <version> Provisions baseline configuration and stores instance profile") fmt.Println(" vssm create <name> <version> Creates the instance configuration and profile")
fmt.Println(" vssm start <name> Launches an existing server instance using stored profile") fmt.Println(" vssm delete <name> <options> Deletes an instance profile, optionally deletes all files with the `--purge` flag")
fmt.Println(" vssm start <name> Launches an existing server instance from a stored profile")
fmt.Println(" vssm stop <name> Gracefully shuts down a server instance") fmt.Println(" vssm stop <name> Gracefully shuts down a server instance")
fmt.Println(" vssm cmd <name> \"<command>\" Dispatches a terminal console command down the pipe") fmt.Println(" vssm cmd <name> \"<command>\" Sends a command to an instance")
fmt.Println(" vssm list Displays the operational matrix of all instances") fmt.Println(" vssm list Displays a list of all instances and their status")
} }