Browse Source

add logging

Matthew R. Kasun 3 years ago
parent
commit
f0a389dfd0
2 changed files with 3 additions and 5 deletions
  1. 0 3
      netclient/command/commands.go
  2. 3 2
      netclient/daemon/freebsd.go

+ 0 - 3
netclient/command/commands.go

@@ -49,9 +49,6 @@ func Join(cfg config.ClientConfig, privateKey string) error {
 		return err
 		return err
 	}
 	}
 	ncutils.PrintLog("joined "+cfg.Network, 1)
 	ncutils.PrintLog("joined "+cfg.Network, 1)
-	if cfg.Daemon != "off" {
-		err = daemon.InstallDaemon(cfg)
-	}
 	if ncutils.IsWindows() {
 	if ncutils.IsWindows() {
 		ncutils.PrintLog("setting up WireGuard app", 0)
 		ncutils.PrintLog("setting up WireGuard app", 0)
 		time.Sleep(time.Second >> 1)
 		time.Sleep(time.Second >> 1)

+ 3 - 2
netclient/daemon/freebsd.go

@@ -3,8 +3,8 @@ package daemon
 import (
 import (
 	"fmt"
 	"fmt"
 	"log"
 	"log"
-	"path/filepath"
 	"os"
 	"os"
+	"path/filepath"
 
 
 	"github.com/gravitl/netmaker/netclient/ncutils"
 	"github.com/gravitl/netmaker/netclient/ncutils"
 )
 )
@@ -104,7 +104,8 @@ netclient_args="daemon"`
 }
 }
 
 
 func FreebsdDaemon(command string) {
 func FreebsdDaemon(command string) {
-	_, _ = ncutils.RunCmd(fmt.Sprintf("service netclient %s", command), true)
+	_, err := ncutils.RunCmd(fmt.Sprintf("service netclient %s", command), true)
+	ncutils.Log("error from RunCmd " + err.Error())
 }
 }
 
 
 func CleanupFreebsd() {
 func CleanupFreebsd() {