/
githubmirror
/
client
Обзор
Документация
Войти
/
githubmirror
/
client
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
go/install/stop_windows.go
44 строки
1 KB
chrisnojima-zoom
Version 670 - clean2 (#29122)
08 июн 2026, 19:31
Не верифицирован
08 июн 2026, 19:31
1943197
Код
Авторство
О чём код?
// Copyright 2019 Keybase, Inc. All rights reserved. Use of // this source code is governed by the included BSD license. //go:build windows package install import ( "fmt" "os" "path/filepath" "github.com/keybase/client/go/libkb" keybase1 "github.com/keybase/client/go/protocol/keybase1" ) // StopAllButService on windows can only stop those services which are not managed // by the watchdog, because this is intended to be called before the service is shut down, // and the watchdog dies when the service exists gracefully. func StopAllButService(mctx libkb.MetaContext, exitCode keybase1.ExitCode) { var err error defer mctx.Trace(fmt.Sprintf("StopAllButService()"), &err)() mountdir, err := mctx.G().Env.GetMountDir() if err != nil { mctx.Error("StopAllButService: Error in GetCurrentMountDir: %s", err.Error()) } else { // open special "file". Errors not relevant. exitFile := "\\.kbfs_unmount" if exitCode == keybase1.ExitCode_RESTART { exitFile = "\\.kbfs_restart" } unmountPath := filepath.Join(mountdir, exitFile) mctx.Info("StopAllButService: opening %s", unmountPath) _, err = os.Open(unmountPath) if err != nil { mctx.Debug("StopAllButService: unable to unmount kbfs (%s) but it might still have shut down successfully", err) } err = libkb.ChangeMountIcon(mountdir, "") if err != nil { mctx.Error("StopAllButService: unable to change mount icon: %s", err) } } }