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

Set postgres to start on boot. #16

Merged
merged 1 commit into from Oct 12, 2018
Merged

Set postgres to start on boot. #16

merged 1 commit into from Oct 12, 2018

Conversation

ghost
Copy link

@ghost ghost commented Oct 12, 2018

Overview

Brief summary

  • use update-rc.d to set postgres to start on boot.

Closes #

Testing

  1. Run docker build, see that the rc command runs withhout error.

@ghost ghost self-assigned this Oct 12, 2018
@ghost ghost added the in progress label Oct 12, 2018
@zeppelin-adazza
Copy link
Contributor

This change is Reviewable

Copy link
Contributor

@SpainTrain SpainTrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 1 approvals obtained (waiting on @ben-adazza)


images/finatra-postgres/Dockerfile, line 21 at r1 (raw file):

USER postgres
RUN service postgresql start &&\
    psql --command "CREATE USER adazza WITH SUPERUSER PASSWORD 'adazza';"

I missed whether the reason for the && (vs 2 lines) was in the previous PR .


images/finatra-postgres/Dockerfile, line 26 at r1 (raw file):

USER root
RUN update-rc.d postgresql enable

Given that these containers spin up, run some commands, then get destroyed, I am not sure I understand this? Does starting the service not work? Maybe service postgresql start should be run as root.

Copy link
Contributor

@SpainTrain SpainTrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @ben-adazza)

a discussion (no related file):
I am guessing this change is because postgres wasn't running

I am testing some of my questions below so feel free to ignore those for now


Copy link
Author

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @ben-adazza)


images/finatra-postgres/Dockerfile, line 21 at r1 (raw file):

Previously, SpainTrain (Mike S) wrote…

I missed whether the reason for the && (vs 2 lines) was in the previous PR .

Just copy pasta from the internet. Making them two lines is ok with me.


images/finatra-postgres/Dockerfile, line 26 at r1 (raw file):

Previously, SpainTrain (Mike S) wrote…

Given that these containers spin up, run some commands, then get destroyed, I am not sure I understand this? Does starting the service not work? Maybe service postgresql start should be run as root.

This is so when the container boots postgres is also started on boot.

Copy link
Contributor

@SpainTrain SpainTrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @SpainTrain and @ben-adazza)


images/finatra-postgres/Dockerfile, line 21 at r1 (raw file):

Previously, ben-adazza (Ben McNiel) wrote…

Just copy pasta from the internet. Making them two lines is ok with me.

it was good copy pasta, because it is indeed required :-D

SpainTrain
SpainTrain previously approved these changes Oct 12, 2018
Copy link
Contributor

@SpainTrain SpainTrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit: after going back to original revision

Reviewable status: 1 change requests, 0 of 1 approvals obtained (waiting on @ben-adazza)

a discussion (no related file):
Sorry for the distracting questions, I should have just done manual testing to understand what was going on. The original revision is good.


@ghost ghost force-pushed the enable-postgres branch 2 times, most recently from 483eb2b to 7867ade Compare October 12, 2018 16:56
Use more descriptive test user name.
Copy link
Contributor

@SpainTrain SpainTrain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Reviewed 2 of 2 files at r3.
Reviewable status: 0 of 1 approvals obtained

@SpainTrain SpainTrain merged commit a869e1c into master Oct 12, 2018
@SpainTrain SpainTrain deleted the enable-postgres branch October 12, 2018 19:42
@ghost ghost removed the in progress label Oct 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants