kardianos / service

Run go programs as a service on major platforms.
zlib License
4.44k stars 677 forks source link

windows 10 cannot install service #155

Open reechou opened 5 years ago

reechou commented 5 years ago

I run the sample, but when I run "sample install", it's alway there, not stop and not end, the "sample" is still running, but do nothing, what I should do? image image

Sozialarchiv commented 5 years ago

Did you tried by opening the console with admin privileges?

whatarule commented 5 years ago

I've found we need to pass the arg as a service flag to exe, like "db-sync-up.exe -service install".

whatarule commented 5 years ago

Nope. Need something like below to pass args to exe. Thanx. if len(os.Args) > 1 { err = service.Control(s, os.Args[1]) if err != nil { log.Fatal(err) } return }

whatarule commented 5 years ago

"logging" example is for flag usage.