Hi there,
First let me introduce myself. My name is David Marceau. I am attempting to
learn gnade 1.5.1 on Debian so that I can help upgrade the Debian .deb to 1.5.3
on the "unstable" version of Debian.
I am aiming for a gnade-1.5.(1|3).deb/.rpm that you just install as root and the
postgres/mysql/whatever demo runs successfully on localhost because the
installation does all the needed configuration.
I don't want to go against the grain of any efforts already in-place. I aiming
for an easy way for others to wind-up into the gnade usage that's all. The
current sourceforge configure is quite complex to follow/understand and that's
why FOR THE MOMENT I have circumvented it to just make the gnade postgres demo
work for now. Eventually I will have to conform to the current configure though
:) Thanks for your patience. I just want to see the postgresql gnade demo
build and run for the moment and understand what's going on.
I've got the gnade postgres demo building. My problem is this postgres
authentication stuff. For the short term I just want everything to run as root
and then I'll work at the user/permission indirections at the oskernel level and
then the database level(postgresql in this case).
QUESTION:
---------
Could someone knowledgeable of postgres recommend to me a quick and dirty root
configuration in that manner I can just build and run as root for the moment?
Concerning pg_hba.conf and pg_ident.conf, I tried a couple of things.
In pg_hba.conf:
#pg_ctl reload if you changed this file
#Added as requested by Ludovic Brenta
#The following user is proposed for the gnade (gnat Ada95 and Ada0x) Bindings:
#BTW it doesn't work yet
#local all gnadeuser md5
#BTW this root hack did work either
#local all root md5
#I am trying to make this root hack work
#see the details of myrootmap in /var/lib/postgres/data/pg_ident.conf
local all root ident
myrootmap
In pg_ident.conf:
#pg_ctl reload if you changed this file
# MAPNAME IDENT-USERNAME PG-USERNAME
myrootmap root postgres
I added some environment variables to my root .bashrc:
#for the postgresql environment stuff
export PATH=$PATH:/usr/lib/postgresql/bin
export POSTGRES_DATA=/var/lib/postgres/data
export POSTGRES_HOME=/var/lib/postgres
export PGDATA=$POSTGRES_DATA
export PGLIB=/usr/lib/postgresql/lib
. /etc/postgresql/postmaster.conf
I still get this silly authentication error no matter with all the different
permutations and combinations I have tried with postgres/gnadeuser/root:
omac:~# psql gnadedb
psql: FATAL: IDENT authentication failed for user "root"
omac:~#
And a similar error when running the gnade postgres demo:
Name : gnadedb
User : root
Password : ICHANGEDTHIS
Host : localhost
Port : 5432
TTY :
Options :
Status : CONNECTION_BAD
Server-PID : 0
Error : FATAL: IDENT authentication failed for user "root"
Parameters : host=localhost dbname=gnadedb user=root password=
PostgreSQL no connection to the server
/gnade-1.5.1/samples/postgres# make
gnatprep -DDBNAME=\"gnadedb\" -DDBUSER=\"root\" -DDBPASSWD=\"ICHANGEDTHIS\"
demo.gpb demo.adb
gnatmake -Ppostgresql.gpr
gnatgcc -c -gnatQ -o ./demo.o -g -gnatA ./demo.adb
gnatbind -static -x demo.ali
gnatlink -g /usr/lib/libgnadepostgresql.a -o ./demo demo.ali
cat postgresql.gpr
project PostgreSQL is
for Languages use ("Ada");
--which directory should hold the input source files
for Source_Dirs use
(
"/usr/share/ada/adainclude/gnade"
, "."
);
--which directory should hold the generated .o object binaries
for Object_Dir use ".";
--which directory should hold the generated executeable binary
for Exec_Dir use ".";
--which source file contains the main driver i.e. like a C int main()
for Main use ("demo.adb" );
for Source_files use ("demo.adb");
package Linker is
for Default_Switches ("ada")
use ("-g", "/usr/lib/libgnadepostgresql.a");
end Linker;
package Binder is
for Default_Switches ("ada") use ("-static");
end Binder;
package Compiler is
for Default_Switches ("ada") use ("-g");
end Compiler;
package Builder is
for Default_Switches ("ada")
use ( "-gnatQ");
end Builder;
end PostgreSQL;
cat Makefile
SAMPLEDB=gnadedb
DBUSER=root
DBPASSWD=ICHANGEDTHIS
APP_LINK_FLAGS=
ADDR2LINES=y
ADAMAKE=gnatmake
ADAPREP=gnatprep
all:: demo
PREPFLAGS= -DDBNAME=\"$(SAMPLEDB)\" \
-DDBUSER=\"$(DBUSER)\" -DDBPASSWD=\"$(DBPASSWD)\"
ifeq ( $(ADDR2LINES), y )
PREPFLAGS=$(PREPFLAGS) -Daddr2lines
endif
demo: demo.adb
$(ADAMAKE) -Ppostgresql.gpr
demo.adb: demo.gpb postgresql.gpr
$(ADAPREP) $(PREPFLAGS) demo.gpb demo.adb
demo.gpb and demo.adb are the untouched ones from the sourceforge gnade 1.5.1
sources.
Any suggestions.
Thanks for considering my request.
BTW eventually I will attempt to do standalone projects/mods like the above for
mysql and the rest but for the moment it is postgresql. Eventually I would like
the package installer(.deb/.rpm/whatever)
to ask more questions as to
what default database/default os-level-build-n-run user
and
what default database-user to install.
I am proposing a
os-level-build-n-run user:gnadeuser or root
for building gnade stuff
along with a
database-user:gnadedatabaseuser
for connecting/creating/managing/accessing a gnade demo database.
One more thing: the user/connections allowed are only for localhost connections
on the designated database port. This is tricky because it involves talking to
the firewall configuration at hand maybe to enable the port if you have a
firewall. I'm not sure if it is the firewall that is getting in the way. It
would be nice if there was a small tool to confirm the dbms port is available
for use at localhost. I think I am going to have to read up on netcat and
figure out a small script to be a web server on the dbms port and then access it
to see if the firewall is in the way before I startup /etc/init.d/postgresql
start. I'll add this dbmsportopenforlocalhosttest to the project if you want
unless someone else has an easier way.
Cheers.
David Marceau
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
|