Skip to content

Conversation

@tmclaugh
Copy link

Fixes an order issue where initdb fails.

@kbarber-jenkins2
Copy link

Can one of the admins verify this patch?

@tmclaugh
Copy link
Author

Here's an example of the issue:

Nov 13 02:44:24 ip-10-183-0-131 puppet-agent[15522]: (/Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns) The files belonging to this database system will be owned by user "postgres".
Nov 13 02:44:24 ip-10-183-0-131 puppet-agent[15522]: (/Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns) This user must also own the server process.
Nov 13 02:44:24 ip-10-183-0-131 puppet-agent[15522]: (/Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns) The database cluster will be initialized with locale en_US.UTF-8.
Nov 13 02:44:24 ip-10-183-0-131 puppet-agent[15522]: (/Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns) The default database encoding has accordingly been set to UTF8.
Nov 13 02:44:24 ip-10-183-0-131 puppet-agent[15522]: (/Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns) The default text search configuration will be set to "english".
Nov 13 02:44:24 ip-10-183-0-131 puppet-agent[15522]: (/Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns) creating directory /usr/share/hubspot/pgsql ... initdb: could not create directory "/usr/share/hubspot/pgsql": Permission denied
Nov 13 02:44:24 ip-10-183-0-131 puppet-agent[15522]: /usr/bin/initdb --encoding '' --pgdata '/usr/share/hubspot/pgsql' returned 1 instead of one of [0]
Nov 13 02:44:24 ip-10-183-0-131 puppet-agent[15522]: (/Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns) change from notrun to 0 failed: /usr/bin/initdb --encoding '' --pgdata '/usr/share/hubspot/pgsql' returned 1 instead of one of [0]
Nov 13 02:44:24 ip-10-183-0-131 puppet-agent[15522]: (/Stage[main]/Postgresql::Server::Initdb/File[/usr/share/hubspot/pgsql]) Dependency Exec[postgresql_initdb] has failures: true
Nov 13 02:44:24 ip-10-183-0-131 puppet-agent[15522]: (/Stage[main]/Postgresql::Server::Initdb/File[/usr/share/hubspot/pgsql]) Skipping because of failed dependencies

This isn't an issue typically because when using the default $datadir the package has usually taken care of things.

[tmclaughlin@tmc-puppetcadb-0 ~]$ rpm -qlv postgresql-server| grep /var/lib
drwx------ 2 postgrespostgres 0 Oct 29 20:12 /var/lib/pgsql
-rw-r--r-- 1 postgrespostgres 85 Oct 29 20:12 /var/lib/pgsql/.bash_profile
drwx------ 2 postgrespostgres 0 Oct 29 20:12 /var/lib/pgsql/backups
drwx------ 2 postgrespostgres 0 Oct 29 20:12 /var/lib/pgsql/data

@apenney
Copy link

apenney commented Nov 19, 2013

test this please

@kbarber-jenkins2
Copy link

Merged build triggered.

@kbarber-jenkins2
Copy link

Merged build started.

@apenney
Copy link

apenney commented Nov 19, 2013

lets see if the bot is feeling helpful!

@kbarber-jenkins2
Copy link

Merged build finished.

@kbarber-jenkins2
Copy link

Test PASSed.
Refer to this link for build results: http://box.bob.sh:8080/job/puppetlabs-postgresql/416/

apenney pushed a commit that referenced this pull request Nov 19, 2013
Exec['postgresql_initdb'] needs to be done after $datadir exists
@apenney apenney merged commit fdf5f04 into puppetlabs:master Nov 19, 2013
cegeka-jenkins pushed a commit to cegeka/puppet-postgresql that referenced this pull request Oct 23, 2017
Exec['postgresql_initdb'] needs to be done after $datadir exists
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants