LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



Reply
 
Search this Thread
Old 09-28-2006, 03:46 AM   #1
coolrock
Member
 
Registered: Sep 2006
Location: Singapore
Distribution: Slackware Linux
Posts: 48

Rep: Reputation: 15
PostgreSql Error


Closed. Error @ http://www.linuxquestions.org/questi....php?p=2445805

Last edited by coolrock; 10-02-2006 at 01:50 AM.
 
Old 09-28-2006, 05:32 AM   #2
coolrock
Member
 
Registered: Sep 2006
Location: Singapore
Distribution: Slackware Linux
Posts: 48

Original Poster
Rep: Reputation: 15
Help pls? =\
 
Old 09-28-2006, 03:44 PM   #3
etrumbo
Member
 
Registered: Apr 2005
Location: Michigan, USA
Distribution: Slackware
Posts: 39

Rep: Reputation: 16
Hi coolrock,

Looks like those Netdisco scripts expect the PostgreSQL command line utilities to be in your path. The default directory for a PostgreSQL installation is /usr/local/pgsql,
so you can either add /usr/local/pgsql/bin to your PATH, or modify the Netdisco scripts to reference those commands at their full path.
 
Old 09-28-2006, 09:22 PM   #4
coolrock
Member
 
Registered: Sep 2006
Location: Singapore
Distribution: Slackware Linux
Posts: 48

Original Poster
Rep: Reputation: 15
Hmm, how do I go around adding it into my PATH?

Quote:
Originally Posted by etrumbo
you can either add /usr/local/pgsql/bin to your PATH.
 
Old 09-28-2006, 09:35 PM   #5
coolrock
Member
 
Registered: Sep 2006
Location: Singapore
Distribution: Slackware Linux
Posts: 48

Original Poster
Rep: Reputation: 15
I also found the CREATEUSER executable at /usr/src/postgresql-8.1.4/src/bin/scripts

Advice pls?

Thanks in advance.

Jason

*UPDATE:
undo the changes. trying out etrumbo's help

Last edited by coolrock; 09-28-2006 at 09:48 PM.
 
Old 09-28-2006, 09:41 PM   #6
etrumbo
Member
 
Registered: Apr 2005
Location: Michigan, USA
Distribution: Slackware
Posts: 39

Rep: Reputation: 16
Hi coolrock,

Sorry, I should have offered more detail.

First, let's find out where your PostgreSQL is installed. The first Netdisco script was calling the 'createdb' and 'createuser' commands, so we'll look in the standard location for these files. From a terminal, run:

ls /usr/local/pgsql/bin

If you get a file list that includes createuser and createdb, then we've found it and we can continue.

Next, run this from your terminal:

export PATH=$PATH:/usr/local/pgsql/bin

Now try that first Netdisco script. If it works now, we'll have to make that path change permanent (the above step is temporary).

In your home directory, use your preferred editor to edit (or create, if it doesn't exist) the file '.bash.profile'. Add that 'export ...' command from above to .bash_profile and save it, then it will take effect each time you log in.
 
Old 09-28-2006, 09:49 PM   #7
etrumbo
Member
 
Registered: Apr 2005
Location: Michigan, USA
Distribution: Slackware
Posts: 39

Rep: Reputation: 16
Hi coolrock,

I just saw your updates to your posts. It seems that you have yet to install and run PostgreSQL, and this Netdisco is expecting that. Go to that /usr/src/postgres... directory and follow the instructions for installing PostgreSQL. Once that's done, you can proceed to Netdisco setup.
 
Old 09-28-2006, 09:49 PM   #8
coolrock
Member
 
Registered: Sep 2006
Location: Singapore
Distribution: Slackware Linux
Posts: 48

Original Poster
Rep: Reputation: 15
Hi etrumbo,

Thanks for the quick reply. When you point to home directory, is it the directory I am in right after i log in? /home/tech.

Quote:
Originally Posted by etrumbo
In your home directory, use your preferred editor to edit (or create, if it doesn't exist) the file '.bash.profile'. Add that 'export ...' command from above to .bash_profile and save it, then it will take effect each time you log in.
Results:
root@nimrod3:/usr/local/netdisco/sql# ls /usr/local/pgsql/bin
clusterdb createuser dropuser ipcclean pg_ctl pg_resetxlog postmaster vacuumdb
createdb dropdb ecpg pg_config pg_dump pg_restore psql
createlang droplang initdb pg_controldata pg_dumpall postgres reindexdb
root@nimrod3:/usr/local/netdisco/sql# export PATH=$PATH:/usr/local/pgsql/bin

root@nimrod3:/usr/local/netdisco/sql# ./pg_init
--> Creating User netdisco.
Choose a password just for this new database user.
/bin/bash: createuser: command not found
Creating Database netdisco. Use the Password used above.
/bin/bash: createdb: command not found

Still the same

Last edited by coolrock; 09-28-2006 at 09:53 PM.
 
Old 09-28-2006, 09:55 PM   #9
coolrock
Member
 
Registered: Sep 2006
Location: Singapore
Distribution: Slackware Linux
Posts: 48

Original Poster
Rep: Reputation: 15
To provide more information for assistance, here's where I locate createuser and createdb

root@nimrod3:/usr/local/netdisco/sql# locate createuser
/usr/src/postgresql-8.1.4/doc/src/sgml/ref/createuser.sgml
/usr/src/postgresql-8.1.4/doc/man1/createuser.1
/usr/src/postgresql-8.1.4/src/bin/scripts/createuser
/usr/src/postgresql-8.1.4/src/bin/scripts/createuser.c
/usr/src/postgresql-8.1.4/src/bin/scripts/createuser.o
/usr/local/pgsql/bin/createuser
/usr/local/pgsql/doc/html/sql-createuser.html
/usr/local/pgsql/doc/html/app-createuser.html
/usr/local/pgsql/man/man1/createuser.1

root@nimrod3:/usr/local/netdisco/sql# locate createdb
/usr/src/postgresql-8.1.4/doc/src/sgml/ref/createdb.sgml
/usr/src/postgresql-8.1.4/doc/man1/createdb.1
/usr/src/postgresql-8.1.4/src/bin/scripts/createdb.c
/usr/src/postgresql-8.1.4/src/bin/scripts/createdb.o
/usr/src/postgresql-8.1.4/src/bin/scripts/createdb
/usr/local/pgsql/bin/createdb
/usr/local/pgsql/doc/html/tutorial-createdb.html
/usr/local/pgsql/doc/html/manage-ag-createdb.html
/usr/local/pgsql/doc/html/app-createdb.html
/usr/local/pgsql/man/man1/createdb.1
 
Old 09-28-2006, 10:09 PM   #10
coolrock
Member
 
Registered: Sep 2006
Location: Singapore
Distribution: Slackware Linux
Posts: 48

Original Poster
Rep: Reputation: 15
I managed to run createuser in the command line interface, but not by running the ./pg_init. However I still experience errors, Any pros/veteran in this field can lend me a hand or some advices?

root@nimrod3:/usr/local/netdisco/sql# createuser
Enter name of role to add: test
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n
createuser: could not connect to database postgres: could not connect to server: No such file or dir
ectory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Thanks in advance.
 
Old 09-29-2006, 02:58 AM   #11
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
If pg_init is a script (and stupidly enough assumes createuser to be in
a different place OR switches to a different user as it goes), edit it
respectively :}



Cheers,
Tink
 
Old 09-29-2006, 04:54 AM   #12
etrumbo
Member
 
Registered: Apr 2005
Location: Michigan, USA
Distribution: Slackware
Posts: 39

Rep: Reputation: 16
Hi coolrock,

OK, based on post #9 I can see that PostgreSQL is installed and in the standard location, but the other errors you're getting indicate that PostgreSQL isn't running. So, refer to the INSTALL file in your /usr/src/postgres... directory. That begins with a Quick Install section which just lists the commands to go from a source download to a tested installation of Postgres. It looks like you've already done everything up through 'gmake install', at least.

By following those quick install directions from that point, you'll set up and launch (temporarily) the 'postmaster' server process that handles connections to Postgres. If that works, you'll want to make Postgres start automatically at each boot. Go to the /usr/src/postgres... directory and find the subdirectory contrib/start-scripts, there should be a file called 'linux'. Copy this to /etc/rc.d/rc.pgsql, make it executable (chmod 755 rc.pgsql), and add a reference to it in your /etc/rc.d/rc.local like this:

if [ -x /etc/rc.d/rc.pgsql ]; then
/etc/rc.d/rc.pgsql start
fi
 
Old 09-30-2006, 07:23 AM   #13
coolrock
Member
 
Registered: Sep 2006
Location: Singapore
Distribution: Slackware Linux
Posts: 48

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by etrumbo
Hi coolrock,

OK, based on post #9 I can see that PostgreSQL is installed and in the standard location, but the other errors you're getting indicate that PostgreSQL isn't running. So, refer to the INSTALL file in your /usr/src/postgres... directory. That begins with a Quick Install section which just lists the commands to go from a source download to a tested installation of Postgres. It looks like you've already done everything up through 'gmake install', at least.

By following those quick install directions from that point, you'll set up and launch (temporarily) the 'postmaster' server process that handles connections to Postgres. If that works, you'll want to make Postgres start automatically at each boot. Go to the /usr/src/postgres... directory and find the subdirectory contrib/start-scripts, there should be a file called 'linux'. Copy this to /etc/rc.d/rc.pgsql, make it executable (chmod 755 rc.pgsql), and add a reference to it in your /etc/rc.d/rc.local like this:

if [ -x /etc/rc.d/rc.pgsql ]; then
/etc/rc.d/rc.pgsql start
fi
I'll take note. Thanks. So far I've not rebooted the computer, there should not be any processes missing. So, how do I start the pgsql if it has not been started? I can't find the pgsql application through locate.

Thanks in advance

Jason
 
Old 09-30-2006, 01:49 PM   #14
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,004
Blog Entries: 11

Rep: Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903Reputation: 903
It should be in the same location as createuser. But that's not the
error you're getting from your pg_init. It can't find createuser;
chances are that it's hardcoded; looking for a different location.

See my previous post.


Cheers,
Tink
 
Old 10-01-2006, 11:31 AM   #15
coolrock
Member
 
Registered: Sep 2006
Location: Singapore
Distribution: Slackware Linux
Posts: 48

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Tinkster
It should be in the same location as createuser. But that's not the
error you're getting from your pg_init. It can't find createuser;
chances are that it's hardcoded; looking for a different location.

See my previous post.


Cheers,
Tink
Thank Tink. I'll try that on monday. As I am away from the "test server", I can't touch anything for now. I hope all of you would still render me assistance if possible.

Thanks in advance.

Jason
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
postgresql tomcat database connectivity error dsids Linux - General 1 04-20-2006 02:19 AM
DB Error: connect failed Postgresql and PHP Manashi Programming 0 03-22-2006 09:10 AM
PostgreSQL trigger dropping error nazdrowie Programming 3 08-03-2005 01:03 AM
Postgresql error FATAL: user "root" does not exist" cgetty Ubuntu 4 06-21-2005 03:11 PM
postgresql -odbc & postgresql-jdbc installation kjsubbu Linux - Software 0 06-19-2003 03:50 AM


All times are GMT -5. The time now is 12:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration