Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

451 B
Raw Blame
//go:build !windows

package agentupdate

import (
	"fmt"
	"os"
	"syscall"
)

var execFn = syscall.Exec

// restartProcess replaces the current process with a new instance.
// On Unix-like systems, this uses syscall.Exec for an in-place restart.
func restartProcess(execPath string) error {
	args := os.Args
	env := os.Environ()

	if err := execFn(execPath, args, env); err != nil {
		return fmt.Errorf("failed to restart: %w", err)
	}

	return nil
}