GRA-408: remove daemon check

This commit is contained in:
Abhishek Kondur 2022-08-02 18:46:30 +04:00
parent 494cd690db
commit e2a7e2c812
2 changed files with 0 additions and 26 deletions

View file

@ -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

View file

@ -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
}