Hi!
On Thu, Mar 01, 2001 at 04:50:07PM +0200,
Sue McGlashan wrote:
> Hi all
>
> I hope someone else has implemented accounting using postgres as the
> database.
>
> If you have, perhaps you can help me with this problem. Daemon is the user
> that does printing, and thus the postgres user
> has to be daemon. Through accounting.pl, daemon changes the number of
> pages left in the database, when a print job is done.
>
> I am using Pg commands in perl in the accounting.pl file to get this to
> work. However, currently, my postgres is running without a passwd
> check, as I have not managed to 'pass' the postgres passwd for daemon in
> the accounting.pl file.
[...]
Just add the password to the connectdb() call. Assuming the
accounting database you connect to is called "accounting" and the
password is "foobar", the call looks like this:
$conn = Pg::connectdb("dbname=accounting password=foobar");
Note that the postgres user is originally created without password
and you will have to provide one (update pg_shadow) before connecting works.
Also, you have to enable password authentication in pg_hba.conf .
Some more notes:
- Providing a clear text password for the postgres user in
accouting.pl is perhaps not a good idea. Consider creating a db
user that is allowed to write on the accounting tables but has no
super user priviliges.
- The Pg module has not proved very stable in our environment. I
recommend using DBI & DBD::Pg instead.
- If you trust your print server and network, and have an ident
daemon running on the print server then you can drop the password
entirely. Instead, insert an "ident sameuser" type authentication
line into your pg_hba.conf, as outlined in the commented
pg_hba.conf that comes with the postgres distribution.
Hope this helps a little,
Ralph Rößner
--
Ralph Rößner TU Darmstadt
Raum 38/B008 Tel. 4333 FB Informatik
EMail: [EMAIL PROTECTED]
-----------------------------------------------------------------------------
YOU MUST BE A LIST MEMBER IN ORDER TO POST TO THE LPRNG MAILING LIST
The address you post from MUST be your subscription address
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------