how do I get windows SCM to restart my service when it fails
I have some windows services that i have written in delphi and they
generally work very well, however on occasion i do get an exception thrown
that can be considered fatal. When this happens the service is designed to
stop.
My question is how do i exit the service in such a way that the SCM will
automatically try to restart the service. (I have already set the recovery
options for the service in the service manager)
MSDN states
A service is considered failed when it terminates without reporting a
status of SERVICE_STOPPED to the service controller.
i have read this blog post Using the Automatic Recovery Features of
Windows Services but i not sure how to implement this in delphi.
i have allready tried the following
Setting the ErrCode Property of the TService to a non zero value.
Setting the stopped Parameter of the ServiceStop Event to false.
Raising an exception in the servicestop event handler.
No comments:
Post a Comment