Opened 15 years ago

Closed 15 years ago

#438 closed enhancement (fixed)

Postgres 8.3 install script

Reported by: darkblueb Owned by: live-demo@…
Priority: normal Milestone:
Component: OSGeoLive Keywords:
Cc:

Description

script install_postgres.sh attempts to make a postgres user "user" as a superuser however, it is currently not working

run the LiveDVD VMWare image execute in the shell sudu su - postgres #enter user psql postgres \du ## observer there is no user "user"

\q

createuser --superuser user

## this works psql postgres alter role "user" with password 'user'; ## give user a password \q

exit psql -d postgres -W #enter user

##now you are in

Change History (9)

comment:1 by darkblueb, 15 years ago

I ran the script maunally, after changing the createuser from $USER to user2

that worked, so I gather that the shell var $USER isnt right

also, add

sudo chmod 600 /home/user/.pgpass

comment:2 by darkblueb, 15 years ago

cameronshorter fixed the bug with USER=user

but now need to set a password/ right after the create user

so, put this in a text file anywhere

alter role "user" with password 'user'

then add to the script sudo -u postgres pqsl -f /path/to/file

comment:3 by hamish, 15 years ago

try updates in r1947 and r1948.

instead of writing to a file, does it work to have the command redirected from stdin?

e.g. does this work:

echo "alter role \"user\" with password 'user'" | sudo -u postgres pqsl

or

sudo -u postgres pqsl << EOF
alter role "user" with password 'user'
EOF

?, Hamish

in reply to:  2 comment:4 by wildintellect, 15 years ago

Replying to darkblueb:

cameronshorter fixed the bug with USER=user

but now need to set a password/ right after the create user

so, put this in a text file anywhere

alter role "user" with password 'user'

then add to the script sudo -u postgres pqsl -f /path/to/file

You shouldn't need to set a password, by default postgres uses ident authentication for localhost connections (aka system users). I tested the script and it worked for me, but I can see how if the USER variable wasn't set right it would cause and issue.

comment:5 by darkblueb, 15 years ago

I tried last night on the Alpha 5.. PgAdmin fails to login out of the box.. setting the password manually for "user" clears things up for me.. The install script for PostGIS data is also failing.. in that case, no user mleslie and no template_postgis table defined..

comment:7 by hamish, 15 years ago

Hi,

some updates in SVN to concern yourselves with if you are concerned about PostGIS:

PostGIS 1.4 tarball download & compile has (optionally) been added to install_postgres.sh. Currently this is switched off.

A few lines in install_postgres.sh were changed outside of the optional bit so please (re)test, including load_postgis.sh.

It has been deactivated until we can solidly determine if it plays nicely with the system & all other packages, and if it passes that a decision on if it should be included at all.

TODO:

  • check if the current scripts still work;
  • check that your packages can still access their data (now and with it enabled);
  • check that the PostGIS 1.4 install doesn't clobber any of the 1.3 packaged install
    • (at least the shp2pgsql binaries need to be renamed?)
  • decide if we will ship PostGIS 1.4 or not

comments? test results?

My personal feeling is to play it conservative and stick with the older packaged version at this point, but then I'm not a PostGIS person so I'm only cognizant of the risks and not the benefits.

Hamish

comment:8 by wildintellect, 15 years ago

Priority: blockernormal
Type: defectenhancement

We actually fixed the defects right? So I'm changing the ticket status. FYI, we still haven't implemented the cleaned data from above but the current script mitigates that until someone moves a copy to a more reliable server.

comment:9 by hamish, 15 years ago

Resolution: fixed
Status: newclosed

nor perfect, but seemingly good 'nuff. closing ticket.

Note: See TracTickets for help on using tickets.