SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
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.
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.
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
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"?
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 :}
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
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.