4kux / winsvc

Automatically exported from code.google.com/p/winsvc
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

net start failed with go1.4rc1 #7

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
go version
go version go1.4rc1 windows/amd64

git clone https://github.com/chai2010/gogs to "github.com/gogits/gogs".
Then run these commands:

1. go build
2. sc create gogs binPath= "$(PWD)\gogs.exe web" displayName= "Go Git Service"
3. net start gogs

net start failed, error code 1067.

Original issue reported on code.google.com by chaishus...@gmail.com on 17 Nov 2014 at 8:19

GoogleCodeExporter commented 8 years ago
go version
go version go1.4rc1 windows/amd64

winsvc\example>example.exe install
2014/11/18 17:16:07 failed to install myservice: SetupEventLogSource() failed: 
SYSTEM\CurrentControlSet\Services\EventLog\Application\myservice registry key 
already exists

Original comment by chaishus...@gmail.com on 18 Nov 2014 at 9:18

GoogleCodeExporter commented 8 years ago
Your program calls os.Exit, instead of running. Here is the stack trace:

0: /root/tempgopath/src/github.com/gogits/gogs/gogs_windows.go:37 main.alex
1: /root/go/root/src/os/proc.go:52 os.Exit
2: /root/tempgopath/src/github.com/gogits/gogs/modules/log/log.go:87 
github.com/gogits/gogs/modules/log.Fatal
3: /root/tempgopath/src/github.com/gogits/gogs/modules/setting/setting.go:150 
github.com/gogits/gogs/modules/setting.NewConfigContext
4: /root/tempgopath/src/github.com/gogits/gogs/routers/install.go:52 
github.com/gogits/gogs/routers.GlobalInit
5: /root/tempgopath/src/github.com/gogits/gogs/cmd/web.go:141 
github.com/gogits/gogs/cmd.runWeb
6: /root/tempgopath/src/github.com/codegangsta/cli/command.go:101 
github.com/codegangsta/cli.Command.Run
7: /root/tempgopath/src/github.com/codegangsta/cli/app.go:130 
github.com/codegangsta/cli.(*App).Run
8: /root/tempgopath/src/github.com/gogits/gogs/gogs_windows.go:83 main.Main
9: /root/go/root/src/runtime/asm_386.s:2287 runtime.goexit

I used code.google.com/p/winsvc/eventlog to dump debug messages to the Event 
Viewer.

You should, probably, do the same to log error messages during service run. 
Otherwise it is impossible to see what the problem is.

Alex

Original comment by alex.bra...@gmail.com on 24 Nov 2014 at 4:56