You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Able to get a service installed and started with your example but does not react to stop or restart. I'm wondering if something like StartServiceCtrlDispatcherW is failing, and we're falling through to daemon_console from daemon_service? Any ideas, or anyone solved this?
I first realized the daemon.name has to match the service name exactly for the lookup to work, but fixing that did not fix this.
After testing determined what is failing when trying to run example; the DaemonWrapper executes daemon.holder.exec().unwrap(); in service_main, which calls Receiver.iter in a blocking loop. service_main thus never returns and service_handler can never receive invocation by system to handle stop or shutdown control signals.
To get this working, executing the daemon.holder.exec function in a new thread. When service_handler receives SERVICE_STOP_PENDING control message it gives the receiver some time to clean up and stop, and then sets the status to SERVICE_STOPPED. Is there a better way to do this?
The text was updated successfully, but these errors were encountered:
noahhai
changed the title
Not respond to stop/restart on windows 10
edited: Example locks daemon wrapper and service_handler never called
Oct 25, 2017
Able to get a service installed and started with your example but does not react to stop or restart. I'm wondering if something like StartServiceCtrlDispatcherW is failing, and we're falling through to daemon_console from daemon_service? Any ideas, or anyone solved this?I first realized the daemon.name has to match the service name exactly for the lookup to work, but fixing that did not fix this.After testing determined what is failing when trying to run example; the DaemonWrapper executes daemon.holder.exec().unwrap(); in service_main, which calls Receiver.iter in a blocking loop. service_main thus never returns and service_handler can never receive invocation by system to handle stop or shutdown control signals.
To get this working, executing the daemon.holder.exec function in a new thread. When service_handler receives SERVICE_STOP_PENDING control message it gives the receiver some time to clean up and stop, and then sets the status to SERVICE_STOPPED. Is there a better way to do this?
The text was updated successfully, but these errors were encountered: