Browse Source

GRA-408: remove daemon check

Abhishek Kondur 3 years ago
parent
commit
e2a7e2c812
2 changed files with 0 additions and 26 deletions
  1. 0 4
      netclient/daemon/common.go
  2. 0 22
      netclient/ncutils/netclientutils.go

+ 0 - 4
netclient/daemon/common.go

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

+ 0 - 22
netclient/ncutils/netclientutils.go

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