FirebirdSQL logo

Introduction

After a successful installation of Firebird, the /opt/firebird/bin directory will contain a number of useful shell scripts.This manual gives details of what these scripts are for and how they are used.

In the remainder of this manual, we will discuss the following scripts:

  • changeDBAPassword.sh

  • createAliasDB.sh

  • fb_config

  • changeRunUser.sh

  • restoreRootRunUser.sh

  • changeGdsLibraryCompatibleLink.sh (Classic server only.)

Note

The above list is correct at the time of writing and, unless otherwise noted, only applies to Firebird 1.5, 2.0 and 2.1 Super Server installed on a Linux system.Other flavours of Unix may have different scripts.I am currently unable to discuss those potential changes as I do not have access to other Unix systems.

ChangeDBAPassword

The changeDBAPassword.sh script allows the password for the SYSDBA user to be changed and various startup scripts etc to have their ownership changed accordingly.The script is run in non-interactive mode as part of the installation process to create an initial randomly generated password which is stored in the /opt/firebird/SYSDBA.password file.

Up until version 2.1 of Firebird, the password is subsequently used in the startup script /etc/rc.d/init.d/firebird, which also has a symlink set up to point to /etc/init.d/firebird.

The security database (/opt/firebird/security.fdb or /opt/firebird/security2.fdb — depending on your Firebird version) is also updated with the new password.

Caution

The script must be run as the root user, and when run, changeDBAPassword.sh will prompt you for the current SYSDBA password and then for a new password.Both of these will appear on the display so for enhanced security, don’t allow anyone to look over your shoulder when you run the script.

After the script has been run, the file /opt/firebird/SYSDBA.password will contain the password in plain text, so make sure that this file is not readable by anyone except root.

The following is an example of running the script to change the SYSDBA password from 'masterkey' to 'biroguin' which, being a made up word, should be less crackable or guessable.

# cd /opt/firebird/bin
# ./changeDBAPassword.sh
Please enter current password for SYSDBA user : masterkey
Please enter new password for SYSDBA user : biroguin
GSEC> GSEC>

Running ed to modify /etc/init.d/firebird
Caution

Whenever you change the SYSDBA password using the gsec utility, you should also change the startup script file as well.To ensure a complete update, always use this script when changing the SYSDBA user’s password.

This doesn’t apply when using Firebird 2.1 and above as the startup script no longer requires the SYSDBA password.

In the example above, the last line of output will not be displayed on systems running Firebird 2.1 and above as the startup scripts are no longer changed when the SYSDBA password is modified.

CreateAliasDB

The createAliasDB.sh script allows the creation of a new database to be carried out, and an alias for that database to be created in the file /opt/firebird/aliases.conf.

Note

The createAliasDB.sh script must be run as the root user.

If your system is not set up properly, the database creation step may fail but the alias will still be added to the aliases file.This could leave you subsequently unable to add the alias properly, as the script checks to ensure that you do not overwrite an existing alias.You will have to manually edit the alias file to remove the broken alias.

All databases must be owned by the firebird user, and by the firebird group.The following shows a new directory being created by the root user to allow Firebird databases to be created.

# cd /u01
# mkdir databases
# chown firebird:firebird databases

At this point the directory /u01/databases is available for use as a repository for one or more Firebird databases.Obviously, in the above example, the /u01 directory already existed.

createAliasDB.sh Parameters

To run the createAliasDP.sh script, use a command line similar to the following:

# createAliasDB.sh <new_alias> <database_name>

The script takes two parameters on the command line, both of which are mandatory:

new_alias

The first parameter is the new alias you wish to create.This alias must not already exist in the alias file, or an error will be displayed and no further action taken.

database_filename

The second parameter specifies the full path to the database file.You must not specify a relative path as this could lead to incorrect database filenames being used at connection time.The script will reject any attempt to pass a relative pathname instead of a full pathname.

A brand new empty database will be created provided that the name passed to the script doesn’t already exist.If the database already exists, only the alias will be created and added to the alias file.