Cleanup before merging to main
This commit is contained in:
@@ -98,14 +98,12 @@ func patchBinaryForNixos(binaryPath string) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
fmt.Println("[NixOS Detected] Patching server interpreter pathway...")
|
||||
fmt.Println("[NixOS Detected] Patching server binary...")
|
||||
|
||||
dotnetRoot := os.Getenv("DOTNET_ROOT")
|
||||
var interpreter string
|
||||
|
||||
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()
|
||||
if err == nil && len(out) > 0 {
|
||||
interpreter = strings.TrimSpace(string(out))
|
||||
|
||||
@@ -30,7 +30,7 @@ func CreateNewInstance(name string, version string, meta InstanceMetadata, cfg *
|
||||
|
||||
instanceConfigPath := filepath.Join(instanceDir, "serverconfig.json")
|
||||
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)
|
||||
|
||||
21
main.go
21
main.go
@@ -71,7 +71,7 @@ func main() {
|
||||
switch subCommand {
|
||||
|
||||
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 {
|
||||
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)
|
||||
req, err := http.NewRequest(method, targetUrl, body)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to construct IPC frame: %v", err)
|
||||
log.Fatalf("Failed to construct IPC request: %v", err)
|
||||
}
|
||||
|
||||
if body != nil {
|
||||
@@ -158,7 +158,7 @@ func sendIPCRequest(cfg *AppConfig, method string, path string, body io.Reader)
|
||||
|
||||
resp, err := http.DefaultClient.Do(req)
|
||||
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()
|
||||
|
||||
@@ -176,7 +176,7 @@ func fetchAndPrintStatus(cfg *AppConfig) {
|
||||
targetUrl := fmt.Sprintf("http://%s/instances/list", listenAddress)
|
||||
resp, err := http.Get(targetUrl)
|
||||
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()
|
||||
|
||||
@@ -191,7 +191,7 @@ func fetchAndPrintStatus(cfg *AppConfig) {
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
@@ -210,10 +210,11 @@ func printUsage() {
|
||||
fmt.Println("\nGlobal Options:")
|
||||
fmt.Println(" --config <path> Explicitly target a non-default config structure file location")
|
||||
fmt.Println("\nUsage Commands:")
|
||||
fmt.Println(" vssm daemon Starts the background process supervisor")
|
||||
fmt.Println(" vssm create <name> <version> Provisions baseline configuration and stores instance profile")
|
||||
fmt.Println(" vssm start <name> Launches an existing server instance using stored profile")
|
||||
fmt.Println(" vssm daemon Starts the daemon")
|
||||
fmt.Println(" vssm create <name> <version> Creates the instance configuration and 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 cmd <name> \"<command>\" Dispatches a terminal console command down the pipe")
|
||||
fmt.Println(" vssm list Displays the operational matrix of all instances")
|
||||
fmt.Println(" vssm cmd <name> \"<command>\" Sends a command to an instance")
|
||||
fmt.Println(" vssm list Displays a list of all instances and their status")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user