mirror of
https://github.com/gravitl/netmaker.git
synced 2025-09-10 23:24:32 +08:00
GRA-408: remove daemon check
This commit is contained in:
parent
494cd690db
commit
e2a7e2c812
2 changed files with 0 additions and 26 deletions
|
@ -14,10 +14,6 @@ import (
|
|||
// InstallDaemon - Calls the correct function to install the netclient as a daemon service on the given operating system.
|
||||
func InstallDaemon() error {
|
||||
|
||||
if ncutils.CheckIfDaemonExists() {
|
||||
return nil
|
||||
}
|
||||
|
||||
os := runtime.GOOS
|
||||
var err error
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@ import (
|
|||
"runtime"
|
||||
"strconv"
|
||||
"strings"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
"github.com/c-robinson/iplib"
|
||||
|
@ -593,24 +592,3 @@ func ModPort(node *models.Node) error {
|
|||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// CheckIfDaemonExists - checks if netclient daemon is up and running
|
||||
func CheckIfDaemonExists() bool {
|
||||
daemonExists := false
|
||||
pid, err := ReadPID()
|
||||
if err != nil {
|
||||
logger.Log(1, "failed to get netclient PID: ", err.Error())
|
||||
return daemonExists
|
||||
}
|
||||
process, err := os.FindProcess(pid)
|
||||
if err != nil {
|
||||
fmt.Printf("Failed to find process: %s\n", err)
|
||||
return daemonExists
|
||||
}
|
||||
err = process.Signal(syscall.Signal(0))
|
||||
if err == nil {
|
||||
daemonExists = true
|
||||
}
|
||||
|
||||
return daemonExists
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue