-
Notifications
You must be signed in to change notification settings - Fork 282
Fix conf_dir
=> data_dir
required for preparing cluster
#231
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
Conversation
OK, I've just rebased the commit because the regression in #228 is:
First error encountered, prompting this PR (Ubuntu minion): stderr:
install: cannot create directory '/var/lib/postgresql': Permission denied
Error: could not create data directory; you might need to run this program with root privileges Another error, even after the initial fix (fresh PostgreSQL installation): stderr:
Error: could not create log directory; you might need to run this program with root privileges |
I've just added another commit in relation to the server starting before |
@@ -62,7 +62,7 @@ postgresql-{{ bin }}-altinstall: | |||
|
|||
postgresql-cluster-prepared: | |||
file.directory: | |||
- name: {{ postgres.conf_dir }} | |||
- name: {{ postgres.data_dir }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for inadvertent mistake on my part.
I had correctly specified data_dir
in this branch but wrong value got merged.
@@ -81,7 +81,7 @@ postgresql-cluster-prepared: | |||
{%- endif %} | |||
- cwd: / | |||
- env: {{ postgres.prepare_cluster.env }} | |||
- runas: {{ postgres.user }} | |||
- runas: {{ postgres.prepare_cluster.user }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the previous value was postgres.prepare_cluster.user
so we should revert.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes. LTGM.
@noelmcloughlin No problem, thanks for the review. |
One general comment regarding |
@noelmcloughlin The main progress was yours in #228 but glad to have been of service.
Except for Debian-based systems of course (due to postgres-formula/postgres/codenamemap.yaml Lines 31 to 33 in 9865664
|
@noelmcloughlin I'm not finding that at my end during a test run: ...
prepare_cluster:
env: []
pgcommand: pg_createcluster 10 testing07 -d
pgtestfile: PG_VERSION
user: root
...
use_upstream_repo: true |
I should have checked the code before my claim. Yeah, the |
@noelmcloughlin @vutny Thanks for #228, that came at the right time for me as well. However, this fix is necessary, since the
data_dir
needs to be in place before preparing the cluster.I've only done basic testing but there also seems to be an issue with starting the server -- otherwise the
postgres.manage
states fail. I resolved this by adding--start
to thepg_createcluster
command. What are your thoughts about this?