Subject Re: How to shutdown Firebird server ?
Author Jocelyn Bernier
> Not really. Let's try to figure out what you mean.
>
Maybe my English is not good but I never thought that it was that
bad ;-)

> 1. I have a server running Firebird in application mode (-a
switch).
>
> -- here you use the word "server" to refer to "machine that
Firebird is running on. Yes or No?
>
Yes for me the server is the machine and the Firebird server is the
application. Or should I say Firebird deamon or Firebird SQL Server ?

> 2. During the night some maintenance need to be done on that
server.
>
> -- "maintenance...on that server" - some kind of work on that
*machine* that is unrelated to Firebird? Yes or No?
>
Yes, maintenance on the server, the machine. Not related to Firebird.

> 3. Before the maintenance start I need to close the Firebird
server and restart it at the end.
>
> -- here "server" means "the Firebird server process". Yes or No.

Yes, Firebird server again mean Firebird for me.

>
> 4. I don't want to kill the Firebird process because I don't want
to corrupt my databases, I want to close it cleanly.
>
> a) "close the Firebird server [process]" and "kill the Firebird
process" mean exactly the same thing to me. What do they mean to
you?
>
Not exactly. For me closing the Firebird (or applications) is not
the same thing as killing the process. Killing a process in Windows
can produce bad results if the application doesn't close by itself.

> b) Why do you think that killing/closing/terminating the Firebird
[server] process would corrupt databases?
>

Because I don't know if all the requested actions have been done by
Firebird. So killing the process while Firebird is working is not a
good idea.

> 5. I know there is already a way to shutdown the database only
but how to do with fbserver.exe ?
>
> -- You don't do it with fbserver.exe, you do it with gfix.
Sorry I wrote this because I saw nothing like this with gfix so I
thought it could be with fbserver.exe like when I started the
Firebird with the -a.

Exactly how you do it depends
>
> (a) on what version of Firebird you are running, which we don't
know

Firebird 2.0

> and
> (b) what users/applications are doing at the time of shutdown. We
don't know this, either.
>

Nobody should be working on the Firebird at that time but I don't
want to take the chance.

> 6. ( BTW I forgot to mention I am running Windows version).
>
> --- fbserver.exe doesn't actually run on anything else. ;-) But,
given that you said before that you can't run Firebird as a service,
do we assume therefore that
>
> a) the host machine is running Windows 98?
>
No the host machines are running Windows 2003, Windows 2000 and in
the worst case, Windows XP. They are also going to Vista :-(

> and
>
> b) the users are 2-tier client/server clients, not browsers
accessing a web application?
>
The users are 3-tier.

> 7. Because you have to ask this question at all, must we assume
that you have users connected and working on databases at the time
you want to kill the Firebird server process? Yes or No?
>

Should not but we never know. Sometime people work late.

> a) you said "during the night" .... "some maintenance..."
> b) you are worried about corrupting databases
>
> 8. If, in reality, the users have all finished their work, shut
down their applications, and gone home for the night, you don't have
to worry about shutting down the *databases*. We don't know,
because you haven't told us what's expecting to be happening at that
time.
>

I already analyzed all that but to be safe I thought it would be
easy to shutdown the Firebird. If I would have installed it as
service I would have just stopped it. But per what I see this look
very complicated. Why ?

> -- you can test whether anyone is logged in to a database by
attempting to rename the database file. If it works, then nobody is
logged in and the database is *already* shut down. You can just go
to Task Manager and stop the Firebird process.
>

That mean all the Firebird jobs have been done ?

> -- if you can't rename the database file then at least one user is
logged in. If it is you, then just log out of whatever application
you are using and try again. If it is not you, and you are the only
human there, then you can perform a database shutdown using gfix.
>

That could explain why I can an error message when the users
shutdown their Windows. A message say that there is still users
connected to Firebird and don't want to close.

> All the unknowns mentioned here are what I was referring to when I
requested that you start again and try to make us understand what
you really want to do...
>
> ./heLen
>

So I did now... ;-)