Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 128291 - postgresql - initdb could not create directory "/var/lib/postgresql"
Summary: postgresql - initdb could not create directory "/var/lib/postgresql"
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs on www.gentoo.org
Classification: Unclassified
Component: Other documents (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: nm (RETIRED)
URL: http://www.gentoo.org/doc/en/jffnms.xml
Whiteboard:
Keywords:
: 128298 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-03-31 13:17 UTC by James Horton
Modified: 2014-04-12 18:17 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description James Horton 2006-03-31 13:17:18 UTC
Following the installation guide, I found these errors:

As user postgres, following the install guide, I issued this command:
 initdb -D /var/lib/postgresql/data

which failed:
initdb: could not create directory "/var/lib/postgresql": Permission denied

I had to 'chmod 777 /var/lib' to allow the  installation to progress.



Then This failed:
'psql template1 postgres <
/usr/portage/net-analyzer/jffnms/files/postgresql_db_tables'

so I had to use:

'psql template1 postgres <
/usr/portage/net-analyzer/jffnms/files/postgresql_db_table'
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-03-31 13:43:33 UTC
The permissions problem is not a documentation bug. File a new bug about the typo, please.
Comment 2 Jakub Moc (RETIRED) gentoo-dev 2006-03-31 14:10:11 UTC
*** Bug 128298 has been marked as a duplicate of this bug. ***
Comment 3 Tiziano Müller (RETIRED) gentoo-dev 2006-11-11 16:00:05 UTC
Well, if you create the database manually, the folder /var/lib/postgresql/data has to be created manually as whell and the owner must be the database-user ("postgres:postgres").
Comment 4 James Horton 2006-11-13 11:31:56 UTC
I see the final comment by Tiziano. Maybe this needs to be reflected
in the installation guide, or reference a document on postgresql
related to a gentoo specific environment?

Maybe somebody with postgresql experience just needs to define
an installation semantic, that will use some simple/default postgress
installation?

Or maybe somebody whos is database literate needs to narrow the option
down to mysql so the packages acutally does install with an

"emerge jffnms"?

Unfortunately, I'm not very knowledgable on databases issues,
especially on gentoo...
Comment 5 Tiziano Müller (RETIRED) gentoo-dev 2006-11-13 12:42:54 UTC
(In reply to comment #4)
> I see the final comment by Tiziano. Maybe this needs to be reflected
> in the installation guide, or reference a document on postgresql
> related to a gentoo specific environment?

Well, no. The standard way to setup the database on Gentoo is using pkg_config, which actually sets the permissions correctly.
If you do it manually, you have to rtfm of postgresql about how to do it.
But it seems that the Jffnms guide doesn't reflect that. Therefore reassigning to the docs-team.

> 
> Maybe somebody with postgresql experience just needs to define
> an installation semantic, that will use some simple/default postgress
> installation?
Well, that's what we're working on.

> 
> Or maybe somebody whos is database literate needs to narrow the option
> down to mysql so the packages acutally does install with an
> 
> "emerge jffnms"?
> 
> Unfortunately, I'm not very knowledgable on databases issues,
> especially on gentoo...
> 

Comment 6 nm (RETIRED) gentoo-dev 2006-11-17 13:29:08 UTC
(In reply to comment #5)
So? What do you want the GDP to do about this? Can we please see a patch for the doc, or a text list of commands to add and where exactly to add them? It's hard to read your mind. Thanks. :)
Comment 7 Tiziano Müller (RETIRED) gentoo-dev 2006-11-18 01:59:34 UTC
Ok, just replace this part:

/**************************/
Now, you must prepare PostgreSQL directories. This is done through the initdb command. By default, PostgreSQL data directories are generally stored in /var/lib/postgresql/data.

Important: The following command must be run with your PostgreSQL user. By default this user is generally called "postgres".

Code Listing 2.8: Preparing PostgreSQL Directories

# su - postgres
$ initdb -D /var/lib/postgresql/data
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.

The database cluster will be initialized with locale C.

creating directory /var/lib/postgresql/data ... ok
creating directory /var/lib/postgresql/data/global ... ok
creating directory /var/lib/postgresql/data/pg_xlog ... ok
creating directory /var/lib/postgresql/data/pg_xlog/archive_status ... ok
creating directory /var/lib/postgresql/data/pg_clog ... ok
creating directory /var/lib/postgresql/data/pg_subtrans ... ok
creating directory /var/lib/postgresql/data/base ... ok
creating directory /var/lib/postgresql/data/base/1 ... ok
creating directory /var/lib/postgresql/data/pg_tblspc ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 1000
creating configuration files ... ok
creating template1 database in /var/lib/postgresql/data/base/1 ... ok
initializing pg_shadow ... ok
enabling unlimited row size for system tables ... ok
initializing pg_depend ... ok
creating system views ... ok
loading pg_description ... ok
creating conversions ... ok
setting privileges on built-in objects ... ok
creating information schema ... ok
vacuuming database template1 ... ok
copying template1 to template0 ... ok

WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the -A option the
next time you run initdb.

Success. You can now start the database server using:

    postmaster -D /var/lib/postgresql/data
or
    pg_ctl -D /var/lib/postgresql/data -l logfile start

If initdb was successfully executed, you can go back to your root user and start PostgreSQL. 


/**************************/

with something like this:


/**************************/

If not already done, initialize your PostgreSQL database cluster with:
sudo emerge dev-db/postgresql --config
Comment 8 nm (RETIRED) gentoo-dev 2006-11-18 10:35:03 UTC
Thanks for the info, dev-zero; done as requested.

Fixed in CVS. :)