Subject Re: Firebird service not stopping
Author emb_blaster
--- In firebird-support@yahoogroups.com, "stegt" <stegt@...> wrote:
>
> Hi,
>
> I am trying to write a service that controls our application services and the firebird service in Windows.
>
> ServiceA: controller
> Firebird: Firebird DB service
> ServiceB: our service
> ServiceC: our service
>
> ServiceA is set as automatic startup, and all the others are manual startup.
>
> When ServiceA starts, it starts the Firebird service, then ServiceB and ServiceC. It always waits till the previous service had started before starting the next one.
>
> The problem I have is that when shutting down ServiceA, it shuts down ServiceC, and ServiceB, then shuts down Firebird. More often than not, the Firebird service goes into a 'Stopping' state, but never actually stops, and fbserver.exe stays in the process list until terminated manually.
>
> I have found that if I put a 1 second pause between shutting down ServiceB and Firebird, then Firebird usually shuts down normally, so I can only assume there is an something happening in Firebird when all the connections terminate, and it is still doing something when I try to shut down the service making it crash.

I dont work that much with services, but maybe that, when you send shuttdown signal to Firebird, ServiceB shutting down are not yet finalized. If that is true, you need something to wait till properly shutting down of ServiceB to then shutt down Firebird Service.

I am not sure, but seems that is the problem.

Regards,