LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-09-2011, 04:00 AM   #1
jogin4groups
LQ Newbie
 
Registered: May 2011
Posts: 2

Rep: Reputation: 0
Not able to run initdb with chroot


Hi,

I want to run new postgres version with chroot in old environment.

I have compiled postgres, took related stuff and tried to run it.

The command works fine as below :

[root@manage /root]# /usr/sbin/chroot /var/newrootpg usr/local/pgsql/bin/initdb --help
initdb initializes a PostgreSQL database cluster.

Usage:
initdb [OPTION]... [DATADIR]

Options:
-A, --auth=METHOD default authentication method for local connections
[-D, --pgdata=]DATADIR location for this database cluster
-E, --encoding=ENCODING set default encoding for new databases
--locale=LOCALE set default locale for new databases
--lc-collate=, --lc-ctype=, --lc-messages=LOCALE
--lc-monetary=, --lc-numeric=, --lc-time=LOCALE
set default locale in the respective category for
new databases (default taken from environment)
--no-locale equivalent to --locale=C
--pwfile=FILE read password for the new superuser from file
-T, --text-search-config=CFG
default text search configuration
-U, --username=NAME database superuser name
-W, --pwprompt prompt for a password for the new superuser
-X, --xlogdir=XLOGDIR location for the transaction log directory

Less commonly used options:
-d, --debug generate lots of debugging output
-L DIRECTORY where to find the input files
-n, --noclean do not clean up after errors
-s, --show show internal settings

Other options:
-?, --help show this help, then exit
-V, --version output version information, then exit

If the data directory is not specified, the environment variable PGDATA
is used.

Report bugs to <pgsql-bugs@postgresql.org>.


But it creates problem when I actually use it to create a database

[root@manage /root]# /usr/sbin/chroot /var/newrootpg /usr/local/pgsql/bin/initdb -D /var/pgsql/data2
fgets failure: No such file or directory
The program "postgres" is needed by initdb but was not found in the
same directory as "/usr/local/pgsql/bin/initdb".
Check your installation.

where as postgres already exists in that folder,

[root@manage /root]# /usr/sbin/chroot /var/newrootpg /usr/local/pgsql/bin/postgres --version
postgres (PostgreSQL) 9.1.1

So why its unable to find postgres ? Any solution for this ?

Thanks in Advance.
 
  


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
i can`t run mysql in chroot, please help me khang0001 Linux - Software 3 09-21-2011 01:44 AM
chroot to run hd-installed distro's programs from chroot in live distro? silencestone Linux - Software 0 10-12-2007 06:29 AM
Debian 4.0 - postgresql - initdb configuration tovis Debian 1 04-27-2007 05:37 PM
postgres initdb questions! doubleone Linux - Software 2 03-07-2005 08:19 PM
Postgres installation initdb problem bruce64 Linux - Software 3 10-16-2003 01:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 11:02 PM.

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
Open Source Consulting | Domain Registration