Subject Re: [firebird-support] installation - configuration ; troubles : various / newbie :!
Author Helen Borrie
At 03:42 PM 14/08/2003 +0000, you wrote:

>i've spent the past days and nights fighting with firebird, i think
>this *****
>won the first round : i'm exhausted, half-fool and

As you noticed, these scripts are pretty specific to RedHat and
Mandrake. When I can work out why you did what you did in those scripts,
it would be good to document the SuSE differences. Ideally, if we have to
have something THIS different for some distros, we ought to have a choice
of scripts.

Unfortunately, you're probably not going to get any resolution of all this
until the script author returns from his summer break in just over a
week. Hope you don't mind if I make a few comments/ask questions. I have
two installations here: RedHat 8.0 and Mandrake 9.0 +extras. In both
cases, the miniInstall script worked exactly as expected...

>i compiled here all the issues i met, i had solved some of them but
>the others
>below are still resisting and i merely don't understand where it
>went wrong.

I don't get a picture of the "issues" you met. If you have the time and a
good memory, it would be really helpful to get these enumerated.

>this is quit long, any help, any hint, any idea to any of the
>question or problems
>described in this message is welcome.

Some I can answer, some not. It would be really great if we could involve
a couple more people who have installed SS RC4 on SuSE 8.2...

>i've installed firebird super server 1.5 RC4 on a suse 8.2 and it
>runs quite well
>but i've got several issues.
>first of all, i had to make some changes in, here is
>my version :

Could you please explain for the unknowing? I understand that SuSE lacks
the rc.d directory layer under /etc, hence the need to alter that path.
What I can't figure out is why you have all that linking in there. (I
assume LinkLib() is some kind of YaST utility for setting up symlinks...?)

>[ -f $2 ] || ln -s $1 $2
>echo This script will register firebird in /etc/init.d and start it.
>echo press ENTER to continue...
>read x
>cp -iv firebird.initd /etc/init.d/firebird
>chmod -v +x /etc/init.d/firebird
>chkconfig -a firebird
>ln -fs /etc/init.d/firebird /usr/sbin/rcfirebird
>LinkLib /usr/local/firebird/lib/ /usr/lib/libfbcl
>LinkLib /usr/lib/ /usr/lib/
>LinkLib /usr/lib/ /usr/lib/
>LinkLib /usr/local/firebird/lib/ /usr/lib/
>/etc/init.d/firebird start
>i had to make some changes too in the original firebird.initd :
>#! /bin/sh
># Provides: firebird
># Required-Start: $network $remote_fs
># X-UnitedLinux-Should-Start:
># Required-Stop:
># X-UnitedLinux-Should-Stop:
># Default-Start: 2 3 5
># Default-Stop: 0 6
># Short-Description: Start the FireBird DataBase SuperServer master
># Description:
>: ${FIREBIRD:=/usr/local/firebird}
>: ${ISC_PASSWORD:=masterke}
>: ${FBRunUser:=root}
>export FIREBIRD
>export ISC_USER
># Check for missing binaries : test, if fbmgr.bin actually exists
>and check the file is executable.
>[ -x $MANAGER ] || exit 5
># Check for existence of needed config file and read it ; source
>SuSE config.
>#[ -r $FB_SYSCONFIG ] || exit 6
>. /etc/rc.status
># Reset status of this service
>case "$1" in
> start)
> echo -n "Starting FireBird SuperServer:"
> ## Start daemon with startproc(8). If this fails
> ## the return value is set appropriately by startproc.
> startproc -n +20 -u $FBRunUser $MANAGER -start -forever &&
>read x
> # Remember status and be verbose
> rc_status -v
> ;;
> stop)
> echo -n "Shutting down FireBird SuperServer:"
> ## Stop daemon with killproc(8) and if this fails
> ## killproc sets the return value according to LSB.
> $MANAGER -shut
> # Remember status and be verbose
> rc_status -v
> ;;
> try-restart)
> ## Do a restart only if the service was active before.
> ## Note: try-restart is not (yet) part of LSB (as of 1.2)
> $0 status >/dev/null && $0 restart
> # Remember status and be quiet
> rc_status
> ;;
> restart)
> ## Stop the service and regardless of whether it was
> ## running or not, start it again.
> $0 stop
> $0 start
> # Remember status and be quiet
> rc_status
> ;;
> force-reload)
> ## Signal the daemon to reload its config. Most daemons
> ## do this on signal 1 (SIGHUP).
> ## If it does not support it, restart.
> $0 stop && $0 start
> rc_status
> ;;
> status)
> echo
> echo -n "Checking for FireBird SuperServer:"
> # NOTE: checkproc returns LSB compliant status values.
> checkproc -v $FIREBIRD/bin/fbserver
> echo
> echo -n "Checking for firebird GUARDIAN:"
> checkproc -v $FIREBIRD/bin/fbguard
> # NOTE: rc_status knows that we called this init script with
> # "status" option and adapts its messages accordingly.
> rc_status -v
> ;;
> *)
> echo "Usage: $0 {start|stop|status|try-restart|restart|force-
> exit 1
> ;;
>- i'm not familiar with the use of services in INIT INFO paragraph,
>what are the interests of
>loading all of them in Required-start ?

It's commented out, looks as if its only purpose in this
particular daemon is documentation.

>- i tried to bind firebird.conf in this init script ($FB_SYSCONFIG)
>but it fails ; is this idea
>useful and exploitable ?

I'm not clear what you mean by "bind". The engine binary searches for
firebird.conf relative to its own location. It expects it to be in the
directory above its own and it treats that directory as RootDirectory.
Ditto the .msg file and the security databases. I do not know of any way
to vary this. If firebird.conf is not where the engine expects to find it,
then you have trouble, regardless of platform.

>- in the original firebird.initd script there's the line :
>#chkconfig 345 20 80
>what these numbers mean ? runlevel 3,4 and 5 with nice priority +20
>on port 80 ? or something
>completely different ?

I don't know, but they are commented out, anyway.

>i guess RETVAL=$ is the same function as rc_status -v, am i wrong ?

Can't answer that one.

>- when this script starts the server, there's a little wait during
>FBmanager processes but during
>this time this script ends and returns the status 'running' before
>FBmanager gives his message
>'server successfully started'

I haven't observed that at all on RH or Mdk. It might be interesting to
hear others' observations. I don't have SMP on my systems, either. But I
also don't have that nest of symlinks as you do.

>- that's why i added '&& read x' in
>cas start (is there any other
>way to fix that ?)

It sounds as if the "problem" (if any) should be identified before
attempting any kind of fix.

>server runs correctly, i can use firbird utilities as i wish but a
>look in firebird.log shows me :
>PCname1 (Client) DATE-----YEAR
> INET/inet_error: connect errno = 111
>What does that mean ?

It's just the engine picking up some TCP/IP problem. The engine can only
report what it gets back from the network - it can't analyse the problem.

>Moreover, i thought my computer was 'server' and it prints...
>client. Hu.

In Superserver, you can't make any connection to the server except as a
TCP/IP client. In the case of your applications, this will be through the
libfbclient library; the server utilities use the same API but they
connect statically. They are still clients, not part of the server.

>- i've made the same installation, on an other computer, same OS,
>same versions, but when starting
>firebird server, rc.status returns 'running', FBmanager
>returns 'check $FIREBIRD/firebird.log file
>for erros - can not start server' and if i check process, fbguard
>and fbserver run.

That only means it can't start the server, because the server is already
running. You need to stop the server before you can restart it. The fbmgr
-restart switch will do a stop followed by a start.

>(i verified the file hosts.equiv, and are
>written in) ; then :
>$FIREBIRD/bin # ./gsec {ENTER}
>connection rejected by remote interface
>unable to open database
>$FIREBIRD/bin # ./isql {ENTER}
>statement failed
>error, SQL CODE=-923
>but if i do ./gsec (or ./isql) with -user sysdba -password masterkey
>it's okay. I think something is wrong with the export in my firebird
>init script but i don't understand what.

It will have to do with where the server thinks the RootDirectory is. By
default, it is the directory above the fbserver binary. If firebird.conf
isn't there, it then tries to find it in the location pointed to by the
FIREBIRD environment variable. If it's not there, then it's stuck, because
the only other place it would be configured is in firebird.conf itself. If
it can't find the RootDirectory, it can't find the password database,
security.fdb. Try printing printenv() and see what was exported for the
FIREBIRD variable. You can use setenv() to correct it, if necessary.

>Finally, when looking at firebird.log, i see :
>PCname2 (Server) DATE------YEAR
> SERVER/process_packet : connection rejected for root
>why is this one server ? And what this error means ?

The other error was caused by a client. This error was raised by the
server itself: it's just reporting that it rejected the root user's
attempt to connect - those were the failed attempts you reported above.

>- is there any interest in linking libfbclient librairies in a
>directory /usr/lib/firebird instead of directly
>/usr/lib ?


>- why not linking, and ? i don't
>understand when and how use them.

They are the external libraries for language support and the two standard
UDF libraries, respectively. Their location *must* be configured in
firebird.conf if you decide to have them somewhere different to
$FIREBIRD/UDF. You really need to read the comments in firebird.conf (or
in the release notes, if you want more detail than is in the file
itself). The draft release notes are currently circulating in the RC5 kits...

>- i use aliases.conf and modified firebird.conf in order to set
>directories but it doesn't work, even after a restart,
> i must each time specify the complete path. any idea ?

Yep. The server can't find aliases.conf and firebird.conf. All your
problems seem to point to that.

>- why is there several (at least three) processes of fbserver
>running at the same time ?

One process, plus a number of threads. There will be one thread for each
client connection plus, from time to time, one for the garbage collector.

>- i wanted to put an option 'probe' in my init script but FB doesn't
>generates file-like /var/run/ ; is it easy
>and useful to create one ?

What for?

>- what is nagle algorithm ?

It's an optional setting for slow networks. Read the release notes.

>- what's the use of backward compatible parameter ordering ?

You don't need it. It's intended for some interface layers, e.g. IB
Objects, which have built in permanent workarounds for a very old bug (ex
InterBase) regarding the ordering of parameters. It's fixed in 1.5, thus
breaking the workarounds.

>FBGUARD : what is 'signore' ? what is 'onetime' ?

Not exactly sure what these mean in the Linux version, but the Guardian is
there to monitor and, if necessary, restart the server after a crash. I
assume 'onetime' is the switch that tells guardian only to start the server
once and then not restart it if it crashes. 'signore' means 'ignore
something' - i just don't know what it's meant to ignore. :-))

>FBMGR : i noticed the options -start and -forever are not register
>in the help of FBmanager, are there other hidden commands ?

-start is a command, -forever is a start parameter (-once is the other
-show gives you the host name and your user name
-you can use the switches -user and -password to run the fbmgr commands as
-shut stops the server
If you just run fbmgr with no switches, you'll get a shell. Then you have
the -quit command to leave the shell.

>FBSERVER : how use it and its options when started with the
>manager ? i can't see the point of it !

You don't. fbmgr (trivial though it is) is a user interface to the
fbserver binary.

>GDS... : the only option i found to gds_drop is -l (successfully
>removed semaphores) and to gds_relay is... -z. hu, not very useful.
>any available free doc about that ?

Good question. Probably undocumented, since they are not supposed to be
called from the command line. They are utilities that fbserver calls itself.

The -z switch only gives you the server version.

Read the documentation!!!