Updating windows service

Hello, I have a strange behavior when trying to update a windows service. I set a process to start before updating (in temp, wait for execution to finish and a command argument) and an action Stop "Service Name". wyUpdate do not start my process and wyUpdate do not execute stop service action. It trying to kill my service process.

I have my service set with restart service on all recovery actions with delay 0. If I try to update my service wyupdate will make an infinite cycle with kill process, start process, kill process, start process....etc Now I am unable to update my service on all our clients. Could you please help us with one of the problem - start exe before update or execute stop service instead of "kill" process?

I want to mention that the stop action is not timed out.

Thank you.

wyUpdate waits infinitely for a service when starting or stopping services because it assumes your services will be well behaved. wyUpdate has a built-in algorithm that will rollback the updates if your services fails to start or stop. But it sounds like you're trying to build in your own rollback algorithm and this is where the problem is.

Any chance you can reproduce this behavior with a small test service so we can perhaps work around this bad service behavior?

I should also note that we'll be altering the algorithm in the next version of wyUpdate that will allow the user to cancel wyUpdate if a service is failing to start or stop.

Hello, No, I don't want to implement any rollback algorithm. I just set the wyUpdate to stop my service. The service is set with restart service (all 3) in the recovery tab with delay 0. The problem is that when wyUpdate execute the stop action, the OS will try to start again due to the recovery settings. So, in my opinion, wyUpdate is not doing something ok for the stop action. Try please to test windows service stop action when all 3 from the recovery tab are set to restart service and delay is set to 0. Another problem is that if I try to make an exe (console - that should change recovery settings) to start just before update is started, this exe will never be executed due to the fact that wyUpdate will try for an infinite times to stop my service. wyUpdate stops the service, windows seems to understand that there was an error and apply recovery settings (start service) and so on. If I try to stop the service manually everything is OK.

Thank you.

Try please to test windows service stop action when all 3 from the recovery tab are set to restart service and delay is set to 0.

We'll test this out -- I'll get back to you.

Ok, thank you. I will wait your response.

I've been trying to reproduce the bevaior you're getting, but I'm failing to. The service stops right away -- there's no failure, and the "recovery" actions are never called:

[attachment=0]service.recovery.png[/attachment]

That is, the update completes successfully. The service doesn't get into an infinite loop of restarts. Did you add a "Stop service" update action to your update? Because if you have then everything should work fine.

Also make sure your service shuts down cleanly when a shut down is requested. That is, make sure there are no race-conditions, no threads still running, etc, etc.