quasar accounting on ubuntu??
rajaiskandarshah
ulist at gs1.ubuntuforums.org
Thu Jul 21 10:19:59 UTC 2005
extract from a posting by brad pepers on the quasar mailing list:
The most common problems with installing Quasar and getting it up and
running for the first time are failure to create the first company and
failure to connect to the company from a client. The first problem is
usually a matter of database setup issues and the second is either a
firewall problem or a file permissions problem. Here are the steps to
go through to trouble-shoot each of these problems.
1. Creating a company fails:
The causes of this can be either in the database server setup or in
the
Quasar server setup. The way to test this depends on the database
type
being used:
A) PostgreSQL:
The first thing to do is to make sure you've done the following:
- have the PostgreSQL server installed and running
- setup your PostgreSQL access control
- make sure the PostgreSQL server can be accessed using TCP/IP
- create a user with permissions to create databases
- create a user without permission to create databases
To see if PostgreSQL is installed and running, run this command on the
server:
telnet localhost 5432
You should get a "Connected to localhost." message. If you get
"Connection
refused" then the PostgreSQL server is either not installed, ignoring
TCP/IP
connections, or just not running. Check that the PostgreSQL server is
installed and running and if not you will have not done the rest of the
steps
mentioned above so you should refer to the Installation and Setup
manual and
setup the PostgreSQL server properly. If all seems to be installed
and
running then check the postgresql.conf file to see if TCP/IP
connections
are being allowed.
If you got a connection then the PostgreSQL server is running and
allowing
TCP/IP connections so now you need to check if your usernames are
setup
and working. Assuming you used something like the ones mentioned in
the
Installation and Setup manual, I'll use "quasar_dba" for the user with
permission to create databases and "quasar" for the user without that
level of permission. To see if they work, try to connect to the
template1
database using psql like this:
psql -h localhost -U quasar_dba template1
You will likely be prompted for a password for the "quasar_dba" user
and
you should enter in what you picked when you created the user. Make
sure
that what you enter here matches the "DBA Password" field in the
PostgreSQL
driver configuration screen. If this fails then you've not setup the
"quasar_dba" user properly or else your pg_hba.conf file is not
allowing
access in which case you should return to the Installation and Setup
manual
and review the instructions there. If you connected then exit using
Control-D and try this command:
psql -h localhost -U quasar template1
Again enter in the password you setup for the "quasar" user and make
sure
it matches the "Password" field in the PostgreSQL driver configuration
screen. If psql fails to connect then the "quasar" user is not setup
properly and you should review the Installation and Setup guide. If
it
did work then you should exit the psql program using Control-D and
then
try to create a company using the "quasar_dba" user to make sure they
have
the permissions they should:
createdb -h localhost -U quasar_dba test_db
If this works then your "quasar_dba" user is setup properly. If you
want you
can try it using the "quasar" user and it should fail. When done you
can
delete the database using this command:
dropdb -h localhost -U quasar_dba test_db
If all the above is working then the problem is in the Quasar side of
the
setup. Go into quasar_setup and into the Drivers tab and click on the
PostgreSQL driver and then the Configure button. The fields should be
filled in to match what you've setup in PostgreSQL and you can use the
"Test" button to have Quasar test if your information is working or
not.
You will need to make sure you set the "Library" field up to match the
full pathname of the PostgreSQL access library which is usually
something
like "/usr/lib/libpq.so" or sometimes "/usr/lib/libpq.so.3". You can
find the library path using this command:
ldd /usr/bin/psql | grep libpq
If all the above PostgreSQL testing works and the Test button in the
PostgreSQL driver setup works then you should have no problem creating
a
company.
In all the above examples, localhost was used for the address of the
computer
running PostgreSQL which is assuming you are running PostgreSQL on the
same
computer that you are running the Quasar server and that you are using
TCP/IP
to access the PostgreSQL server. Two other options are available. You
could
leave the "Hostname" field blank in the PostgreSQL driver
configuration
screen in quasar_setup which will make Quasar try to connect using
Unix
sockets instead of TCP/IP. This will likely be faster than the TCP/IP
method
but will mean changes in how you setup the pg_hba.conf file so it
should
only be used if you understand PostgreSQL setup well. To test this
option
you should leave off the "-h localhost" in all the above commands.
The
other option is to run the PostgreSQL server on a different computer.
In
this case enter the hostname or IP address of the computer running
PostgreSQL
into the "Hostname" field in the PostgreSQL driver configuration screen
in
quasar_setup and change the "localhost" in the "-h localhost" above to
be
the same hostname or IP address. Again this is a more complicated
setup
and is perhaps less useful since the Quasar server itself uses little
CPU
and the main CPU requirement will be from the database server so they
can
easily both be run on the same computer.
B) Firebird:
The first thing to do is to make sure you've done the following:
- have the Firebird server installed and running
- make sure the Firebird server can be accessed using TCP/IP
- create a non-dba user
To see if Firebird is installed and running, run this command on the
server:
telnet localhost 3050
You should get a "Connected to localhost." message. If you get
"Connection
refused" then the Firebird server is either not installed or not
running.
Check that the Firebird server is installed and running and if not you
will
have not done the rest of the steps mentioned above so you should refer
to
the Installation and Setup manual and setup the Firebird server
properly.
If all seems to be installed and running then check that xinetd or
inetd is
running since the Firebird server is controlled by these services.
If you got a connection then the Firebird server is running so now you
need
to check if your usernames are setup and working. Assuming you used
something
like the ones mentioned in the Installation and Setup manual I'll use
"quasar"
for the non-dba user. To see if the dba connection is working, first
get
into the Firebird ISQL program like this:
export FIREBIRD=/opt/firebird
PATH=$FIREBIRD/bin:$PATH
isql
You should end up at a prompt showing "SQL> " at which point you can
type
this command:
create database 'localhost:/tmp/test.fdb' user 'sysdba' password 'x';
Replace the password 'x' with the sysdba password Firebird is using.
This
can be found in the /opt/firebird/SYSDBA.password file unless you
change
it. If this work you should end up back at the "SQL> " prompt without
any
messages. If it fails, try to figure out from the error message what
is
wrong. If this works make sure the "DBA Password" field in the
Firebird
driver configuration screen matches what you are using here.
Exit out of isql using "quit;" and then try to connect to the new
database
you created as the sysdba user. This should work if the create
database
worked but its worth checking again. Use this command:
isql -u sysdba -p x localhost:/tmp/test.fdb
Replace "x" with the password for the sysdba user that you used above.
You
should get the "SQL> " prompt and you can exit using "quit;". Now try
to
connect again using the non-dba username:
isql -u quasar -p x localhost:/tmp/test.fdb
Again replace "x" with the password you've setup for the "quasar" user
in
Firebird. If the connection fails then you either have the password
wrong
or else you've not setup the non-dba user in which case you should
refer
to the Installation and Setup manual for instruction on doing this.
Make
sure the Firebird driver configuration "Username" and "Password"
fields
match the non-dba username and password you are using here.
To delete the database once you are finished you need to connect to
the
database using isql and the sysdba user as mentioned above and then
use
this commands at the "SQL> " prompt.
drop database;
Use "quit;" to exit after this. One other problem in creating a
company
database with Firebird is permissions to write in the directory that
you've
told Quasar to create the company database. By default this will be
the
/opt/quasar/databases directory but it can be changed in the Firebird
driver
configuration screen. To test this you can go back and run the
"create
database" command again but instead of "/tmp/test.fdb" for the
database
path, try to create the database in the directory you've told Quasar
to
create it (for example use "/opt/quasar/databases/test.fdb"). If this
fails with a permissions problem, check that the directory is giving
permission to write to all users (since the Firebird server will try
to
create a file in this directory as the "firebird" user so this user
will
need permission to write to the directory). Use "ls -ld
/opt/quasar/databases"
to check the permissions and they should be "drwxrwxrwx" but if they
are
not you can change them using this command:
chmod 777 /opt/quasar/databases
If all the above is working then the problem is in the Quasar side of
the
setup. Go into quasar_setup and into the Drivers tab and click on the
Firebird driver and then the Configure button. The fields should be
filled in to match what you've setup in Firebird and you can use the
"Test" button to have Quasar test if your information is working or
not.
You will need to make sure you set the "Library" field up to match the
full pathname of the Firebird access library which is usually
something
like "/opt/firebird/lib/libfbclient.so".
If all the above Firebird testing works and the Test button in the
Firebird driver setup works then you should have no problem creating a
company.
In all the above examples, localhost was used for the address of the
computer
running Firebird which is assuming you are running Firebird on the
same
computer that you are running the Quasar server. You could run the
Firebird
server on a different computer. In this case enter the hostname or IP
address of the computer running Firebird into the "Hostname" field in
the
Firebird driver configuration screen in quasar_setup and change the
"localhost" in the above commands to be the same hostname or IP
address.
This is a more complicated setup and is perhaps not very useful since
the
Quasar server itself uses little CPU and the main CPU requirement will
be
from the database server so they can easily both be run on the same
computer.
C) Sybase:
... TODO: filled this in ...
2. Connecting to the company from the quasar client fails:
The cause of this is either firewall issues on your network or
permission
problems on the files on the server running Quasar. To track down the
source of problems like this, you need to do a set of commands first
on
the server computer where the Quasar server is installed and then again
on
the client computer where the Quasar client is installed (or just on
one
computer if you are running the server and client on one computer).
The first command to try is this:
telnet localhost 3599
You should get a "Connected to localhost" message (if running this on
the
client computer replace localhost with the hostname or IP address of
the
server computer and make sure you are using the same hostname or IP
address in the "quasar" client open company dialog). If you get a
Connection refused error then it usually means that the Quasar server
is
not running though if you are running this from the client computer it
can also mean that there is a firewall issue especially if you already
ran this on the server and it connected properly. If you get this
problem
on the server computer then check that xinetd (or inetd if running a
distribution that uses inetd) is installed and running. If you get
this
problem from the client then check your firewall (and if you are
running
Windows-XP try turning off the Windows Firewall and see if that fixes
it).
Once you have the connection working from the server company and the
client computer then you need to see what companies are available.
While
in telnet type in this command:
resources companies name version
You should get back a list that includes the company definition
filename
and the company name and version number. If the list is blank or
shows
an error then the quasar_clientd process is having problems reading
the
config files or the data files. Make sure the /opt/quasar/config
files
are readable by the "quasar" user and also that the /opt/quasar/data
files
are also readable. These commands will fix the permissions if they
are
wrong:
cd /opt/quasar
... TODO: insert commands here ...
Once you are getting a list of companies you can try logging in to
test
the final stage of what the quasar client does. While in telnet type
in this command:
login {Sample Company.xml} admin admin
Replace the {Sample Company.xml} with the company definition filename
you see from the "resources companies ..." command (you will not need
braces around it if the filename has no spaces in it) and replace the
second "admin" with the admin password you setup in the Server tab of
quasar_setup (if you changed it from the default of "admin"). You
should get back a message of "login: good" but if it fails it will be
"error: " and then an error message that should help pinpoint the
source
of the failure.
One last source of problems is that the Quasar client will only show
the user a list of companies that match the database version the
client
was designed for. So if you update your Quasar on the server and the
client but fail to update your company databases, the client will stop
showing the company as an option to connect to. Also if you update
the server and the company database but forget to update the client,
this
can also make the client stop showing the company as a choice to login
to. To fix this make sure the version of the server and client
packages
match and after an update of Quasar check if you need to update the
databases using the quasar_setup program.
If the above all works on the client computer then you've simulated
all
that the Quasar client will do when logging in and you should not have
any problems accessing your companies from your clients.
--
rajaiskandarshah
More information about the ubuntu-users
mailing list