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服务后,无法正常运行 #360

Open
ahthabc opened this issue May 31, 2023 · 3 comments
Open

注册windows服务后,无法正常运行 #360

ahthabc opened this issue May 31, 2023 · 3 comments

Comments

@ahthabc
Copy link

ahthabc commented May 31, 2023

使用 kardianos/service 这个项目的时候,需要调用run方法

@devops-fj
Copy link

@ahthabc 我这变报1053 注册服务 启动不了 service.go s.start 也改为s.run 也不行 您这边有 好的解决方法吗

@ahthabc
Copy link
Author

ahthabc commented Jun 14, 2023

我尝试了在service.go文件将 service.Service 的变量定义为全局变量,并放入init方法进行初始化,在run方法执行runServer(),然后在main文件中将原来的runServer调用换成s.Run()

@anye88
Copy link

anye88 commented Mar 26, 2024

请问下这个问题解决了吗

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

3 participants