Forum OpenACS Development: pgbin parameter

Collapse
Posted by Pascal Scheffers on
Don asked me to make the pgbin parameter in nsd.tcl optional. Good news: it already is 😊. ns_config returns "" for a non existing option, which comes in handy in this case. Tcl-exec searches the path by default. The pgbin parameter functions as an override. I've got a patch comming up for specifying the correct port on the psql commandline.

I have given up on password logon with psql. I altered the psql source to see what was happening, it seems that psql hardwired to listen to stdin, no mater what. I'll look into that later on.

Collapse
Posted by Don Baccus on
Oh, how funny, of course!  When I first implemented this kludge my PATH pointed to PG 7.0, my PG 7.1 install was in a test directory, so I needed to provide an explicit path to its bin directory.  I never bothered to test without the param after installing PG 7.1 for real.

How embarrassing!  Thanks, Pascal.

Yes, as far as password login I couldn't see any way to make that work, either.  I think you should bring this up with the PG hacker's group.  Yes, it's a security problem to have the password lying around  in clear text but this is already the case for the driver accessing the db via pglib.  Being able to pass the password in to psql via a switch wouldn't increase the security risk at all, at least in our environment.

And, of course, if someone thinks it is a security risk they wouldn't have to use it.

Probably wouldn't get it until 7.2 but it seems like a reasonable thing to lobby for.

Collapse
Posted by Vinod Kurup on
I just took the pgbin parameter out of my config file and tried to load the datamodel:
[09/May/2001:21:29:10][28283.4101][-conn0-] Error: Error sourcing /web/openacs-4/packages/acs-bootstrap-installer/installer/install-data-model.tcl: couldn't execute "psql": no such file or directory while executing "open "|[file join [db_get_pgbin] psql] $pgport -U $pguser -f $file_name [db_get_database]" "r"" (procedure "db_source_sql_file" line 14) invoked from within "db_source_sql_file -callback apm_ns_write_callback "acs-kernel-create.sql"" (file "/web/openacs-4/packages/acs-bootstrap-installer/installer/install-data-model.tcl" line 31) invoked from within "source $__file "
nsadmin's path is:
nsadmin@brookline:~$ echo $PATH /usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/local/pgsql/bin:/ora8/m01/app/oracle/product/8.1.6/bin
/usr/local/pgsql/bin is in there. Anyone know what I'm doing wrong?
Collapse
Posted by Don Baccus on
I may've blown the install of Pascal's patch, or you may've grabbed
sources before I integrated this into the CVS repository (I had a
bunch of my own stuff to finish up before I could commit).

I committed early this evening, when did you try it?  If there's code
in there to pick up pgport then you've got the latest and I blew the
integration (patch didn't like Pascal's file for some reason, even
though it looked OK to me, so I patched by hand).  If the code to find
pgport's not there, then you need to update and try again...

Collapse
Posted by Vinod Kurup on
Ahhhh - I figured out what was wrong... I indeed did have the latest
CVS and there's no problem with the patch that you applied.

The problem was that although nsadmin's path had /usr/local/pgsql/bin,
I start nsd from inittab, so it uses root's path. I created a
nsd-postgres shell script (similar to nsd-oracle) that sets the PATH
before calling nsd and then everything works fine.