-
Notifications
You must be signed in to change notification settings - Fork 685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The service did not respond to the start or control request in a timely fashion. #166
Comments
When run as a service, s.Run will never be called. |
I have done as mentioned above and it did not work. However, when I sent a string as arguments like
It did work. |
the reason is because the code "strCmdArg := os.Args[1]"。when you do not sent a arguments, the process will panic。 |
For what it's worth, I was dealing with a similar issue here. My executable ran just fine on its own, but as a service, it would not start. I ended up copying the full path to the executable from the Service properties and attempting to run that in PowerShell....and...BAM! There was the error I needed to see. I was using viper to load configuration from a JSON file, but I forgot to put the file in my user directory where the Service could find it. |
Hi Anyone My main program calls ControlService with the -run flag, so as shown I have setup the service to call the program with the -service=run flag. Any idea's? Here is my service go file:
|
Hi, while trying to write a basic program using kardianos/service, I am facing the following error. I am able to install the service but when trying to start the service i get "The service did not respond to the start or control request in a timely fashion.". Here is my code
package main
import (
"fmt"
"os"
"github.com/kardianos/service"
"time"
)
type program struct{}
func (p *program) Start(s service.Service) error {
go p.run()
return nil
}
func (p *program) run() {
fmt.Println("In program: Run")
for {
time.Sleep(3 * time.Second)
fmt.Println("Still running")
}
}
func (p *program) Stop(s service.Service) error {
return nil
}
func main() {
}
Please help
The text was updated successfully, but these errors were encountered: