Closed tuchaVshortah closed 1 year ago
Look at https://github.com/mullvad/windows-service-rs/issues/101. I think you're trying to install the service from user, but you can only do that with admin permissions. But also you cannot run the service via cargo run. Windows services have to be started by the system.
Hello! Thanks for your help, but it didn't work. I keep getting the error 1053. Let me explain my code: firstly, main calls a module that functions like ping_module from the examples bundled with windows_service. Most of the module is the exact copy of the example that is provided with the crate, yet I still managed to break something. I have been trying to find what went wrong for a while, but I didn't manage to do so. Please, read a bit of my code if you can and try to find what is wrong with it. I would very much appreciate your review.
Code flow:
P.s. It seems like the error happens on the second step
The bug is fixed now and my service did successfully start. The bug was caused by incorrect CLI option parsing.
And how you fixed it?
And how you fixed it?
You just have to follow all the instructions. Don't try to invent anything like I did. If you are very curious you can check source code of my project: https://github.com/tuchaVshortah/arp-spoofing-detector-rs/tree/main/src/winservice
When running code using this crate I get these 2 errors: Error: Winapi(Os { code: 1063, kind: Uncategorized, message: "The service process could not connect to the service controller." })
Error: Winapi(Os { code: 1053, kind: TimedOut, message: "The service did not respond to the start or control request in a timely fashion." })
The first error usually happens when attempting to start a service using service_dispatcher
The second error also happens when compiling and running examples that are supplied with crate: