diff options
Diffstat (limited to 'client/go/internal/admin/script-utils/services/stop.go')
-rw-r--r-- | client/go/internal/admin/script-utils/services/stop.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/client/go/internal/admin/script-utils/services/stop.go b/client/go/internal/admin/script-utils/services/stop.go new file mode 100644 index 00000000000..f5b764d122e --- /dev/null +++ b/client/go/internal/admin/script-utils/services/stop.go @@ -0,0 +1,35 @@ +// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. +// Author: arnej + +package services + +import ( + "os" + + "github.com/vespa-engine/vespa/client/go/internal/admin/envvars" + "github.com/vespa-engine/vespa/client/go/internal/admin/trace" + "github.com/vespa-engine/vespa/client/go/internal/util" + "github.com/vespa-engine/vespa/client/go/internal/vespa" +) + +func VespaStopServices() int { + if doTrace := os.Getenv(envvars.TRACE_STARTUP); doTrace != "" { + trace.AdjustVerbosity(1) + } + if doDebug := os.Getenv(envvars.DEBUG_STARTUP); doDebug != "" { + trace.AdjustVerbosity(2) + } + err := vespa.LoadDefaultEnv() + if err != nil { + util.JustExitWith(err) + } + err = vespa.MaybeSwitchUser("vespa-stop-services") + if err != nil { + util.JustExitWith(err) + } + vespa.CheckCorrectUser() + trace.Debug("running as correct user") + stopSentinelWithRunserver() + stopProxyWithRunserver() + return 0 +} |