summaryrefslogtreecommitdiffstats
path: root/modules/minwinsvc
diff options
context:
space:
mode:
authorAndrey Nering <andrey.nering@gmail.com>2017-01-23 20:44:23 -0200
committerAndrey Nering <andrey.nering@gmail.com>2017-01-23 20:44:23 -0200
commitfda44760612aad10e556f65cd201e94ed568fbb3 (patch)
tree77bd12c1bb292b4ea63166f0d54ddd724df4de7e /modules/minwinsvc
parent44d4863ecf3d0eb63540f4f10fa2d4760e4daa74 (diff)
downloadgitea-fda44760612aad10e556f65cd201e94ed568fbb3.tar.gz
gitea-fda44760612aad10e556f65cd201e94ed568fbb3.zip
Fix SSH server on Windows when running as service
Closes #680
Diffstat (limited to 'modules/minwinsvc')
-rw-r--r--modules/minwinsvc/svc_windows.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/modules/minwinsvc/svc_windows.go b/modules/minwinsvc/svc_windows.go
index 91e2b6a4dd..c6e87e29df 100644
--- a/modules/minwinsvc/svc_windows.go
+++ b/modules/minwinsvc/svc_windows.go
@@ -8,17 +8,22 @@ package minwinsvc
import (
"os"
+ "strconv"
"sync"
"golang.org/x/sys/windows/svc"
)
var (
- onExit func()
- guard sync.Mutex
+ onExit func()
+ guard sync.Mutex
+ skip, _ = strconv.ParseBool(os.Getenv("SKIP_MINWINSVC"))
)
func init() {
+ if skip {
+ return
+ }
interactive, err := svc.IsAnInteractiveSession()
if err != nil {
panic(err)