Skip to content
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

Windows 10 : service install / service start - "The parameter is incorrect." #328

Closed
Keunho77 opened this issue Jun 3, 2022 · 1 comment

Comments

@Keunho77
Copy link

Keunho77 commented Jun 3, 2022

I'm testing the logging example, but when I start the service, "The parameter is incorrect." error occurs.
The execution environment is the Administrator terminal of Windows 10 Pro.

I deleted the Dependencies item referring to issue #173 like as below.

func main() {
	svcFlag := flag.String("service", "", "Control the system service.")
	flag.Parse()
	options := make(service.KeyValue)
	options["Restart"] = "on-success"
	options["SuccessExitStatus"] = "1 2 8 SIGKILL"
	svcConfig := &service.Config{
		Name:        "GoServiceExampleLogging",
		DisplayName: "Go Service Example for Logging",
		Description: "This is an example Go service that outputs log messages.",
		// Dependencies: []string{
		// 	"Requires=network.target",
		// 	"After=network-online.target syslog.target"},
		Option: options,
	}

Below is the execution log

C:\test\service\example\logging>main.exe -service install

C:\test\service\example\logging>main.exe -service start
2022/06/03 14:21:06 Valid actions: ["start" "stop" "restart" "install" "uninstall"]
2022/06/03 14:21:06 Failed to start Go Service Example for Logging: The parameter is incorrect.

thanks for the advice in advance

@kardianos
Copy link
Owner

This should be solved. I'll tag a new release soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants