Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initdb should create xlogdir if it has been set. #448

Merged
merged 1 commit into from
Aug 21, 2014

Conversation

aswen
Copy link
Contributor

@aswen aswen commented Jul 9, 2014

Initdb script fails if the xlogdir variable has been set but hasn't
been created upon execution of postgresql_initdb if the directory already
exists but not is owned by the postgresql user.
Therefor I've made the require in the exec optional.

Below you find the output when postgresql_initdb runs and the evaluation
of file{$xlogdir} afterwards.

Notice: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns: The files belonging to this database system will be owned by user "postgres".
Notice: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns: This user must also own the server process.
Notice: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns: 
Notice: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns: The database cluster will be initialized with locale "en_US.UTF-8".
Notice: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns: The default database encoding has accordingly been set to "UTF8".
Notice: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns: The default text search configuration will be set to "english".
Notice: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns: 
Notice: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns: Data page checksums are disabled.
Notice: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns: 
Notice: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns: fixing permissions on existing directory /srv/pg/data ... ok
Notice: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns: fixing permissions on existing directory /srv/pglog ... initdb: could not change permissions of directory "/srv/pglog": Operation not permitted
Notice: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns: initdb: removing contents of data directory "/srv/pg/data"
Error: /usr/lib/postgresql/9.3/bin/initdb --encoding '' --pgdata '/srv/pg/data' --xlogdir '/srv/pglog' returned 1 instead of one of [0]
Error: /Stage[main]/Postgresql::Server::Initdb/Exec[postgresql_initdb]/returns: change from notrun to 0 failed: /usr/lib/postgresql/9.3/bin/initdb --encoding '' --pgdata '/srv/pg/data' --xlogdir '/srv/pglog' returned 1 instead of one of [0]
Notice: /Stage[main]/Postgresql::Server::Initdb/File[/srv/pglog]/owner: owner changed 'root' to 'postgres'
Notice: /Stage[main]/Postgresql::Server::Initdb/File[/srv/pglog]/group: group changed 'root' to 'postgres'
Notice: /Stage[main]/Postgresql::Server::Initdb/File[/srv/pglog]/mode: mode changed '0755' to '0700'

Please forgive me for not adding a proper acceptancetest to this because
I have no clue how to check that. I think it passed acceptancetests
before because of ordering issues.

@puppetcla
Copy link

Waiting for CLA signature by @aswen

@aswen - We require a Contributor License Agreement (CLA) for people who contribute to Puppet, but we have an easy click-through license with instructions, which is available at https://cla.puppetlabs.com/

Note: if your contribution is trivial and you think it may be exempt from the CLA, please post a short reply to this comment with details. http://docs.puppetlabs.com/community/trivial_patch_exemption.html

@aswen
Copy link
Contributor Author

aswen commented Aug 14, 2014

This is a trivial contribution.

@igalic
Copy link
Contributor

igalic commented Aug 18, 2014

@aswen and it doesn't merge… could you please rebase it?


…i too think that there needs to be a bit of a discussion regarding CLAs.

i find CLAs warranted for committers. people with merge access. not for random drive-by contributors.

@aswen
Copy link
Contributor Author

aswen commented Aug 19, 2014

@igalic and it's rebased.
May I suggest an improvement on this process: It would save everyone a lot of time if pulls would be merged quicker so this kind of conflicts would occur fewer times. Random drive-by contributor would be motivated much more if there pulls get merged (or at least triaged) quicker and the long queue of pull requests results in a lot of merge conflicts. By the time of submitting this pull merge would have worked perfectly for example.

@igalic
Copy link
Contributor

igalic commented Aug 19, 2014

hunner added a commit that referenced this pull request Aug 21, 2014
Initdb should create xlogdir if it has been set.
@hunner hunner merged commit ed58c05 into puppetlabs:master Aug 21, 2014
cegeka-jenkins pushed a commit to cegeka/puppet-postgresql that referenced this pull request Oct 23, 2017
Initdb should create xlogdir if it has been set.
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.

None yet

5 participants