summaryrefslogtreecommitdiff
path: root/keadm
diff options
context:
space:
mode:
authorwujunyi <wu65830600@163.com>2023-10-27 01:23:22 +0800
committerwujunyi <wu65830600@163.com>2023-10-27 01:23:22 +0800
commit23194d5ad13fe69e9fdb73eb5b9f4b560086292f (patch)
treefa5b280908cd883a29c470682a8ba116f90a4098 /keadm
parentfix: lint (diff)
downloadkubeedge-23194d5ad13fe69e9fdb73eb5b9f4b560086292f.tar.gz
chore: update
Signed-off-by: wujunyi <wu65830600@163.com>
Diffstat (limited to 'keadm')
-rw-r--r--keadm/cmd/keadm/app/cmd/common/constant_windows.go2
-rw-r--r--keadm/cmd/keadm/app/cmd/util/nssm.go23
2 files changed, 20 insertions, 5 deletions
diff --git a/keadm/cmd/keadm/app/cmd/common/constant_windows.go b/keadm/cmd/keadm/app/cmd/common/constant_windows.go
index 8e6aa492f..15c45b27f 100644
--- a/keadm/cmd/keadm/app/cmd/common/constant_windows.go
+++ b/keadm/cmd/keadm/app/cmd/common/constant_windows.go
@@ -1,7 +1,7 @@
//go:build windows
/*
-Copyright 2019 The KubeEdge Authors.
+Copyright 2023 The KubeEdge Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
diff --git a/keadm/cmd/keadm/app/cmd/util/nssm.go b/keadm/cmd/keadm/app/cmd/util/nssm.go
index 6e4228495..cddc40a26 100644
--- a/keadm/cmd/keadm/app/cmd/util/nssm.go
+++ b/keadm/cmd/keadm/app/cmd/util/nssm.go
@@ -1,3 +1,19 @@
+/*
+Copyright 2023 The KubeEdge Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
package util
import (
@@ -57,14 +73,13 @@ func InstallNSSMService(name, path string, args ...string) error {
func IsNSSMServiceExist(service string) bool {
cmd := NewCommand("nssm status " + service)
- _err := cmd.Exec()
- return _err == nil
+ return cmd.Exec() == nil
}
func IsNSSMServiceRunning(service string) bool {
cmd := NewCommand("nssm status " + service)
- _err := cmd.Exec()
- if _err != nil || cmd.ExitCode > 0 {
+ err := cmd.Exec()
+ if err != nil || cmd.ExitCode > 0 {
return false
}
if strings.Contains(cmd.GetStdOut(), "SERVICE_RUNNING") {