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

Fix entrypoint.sh creating one folder named {plugins,embedded-db} #1

Merged
merged 1 commit into from
Oct 14, 2020

Conversation

bdelcamp
Copy link

New install fails to start because required directories are not being created.

@dereckson
Copy link
Member

dereckson commented Oct 13, 2020

Thanks for the fix.

Indeed, both the test and prod scripts test the images with a workflow creating first the directory. So that was under the radar.

@dereckson dereckson closed this Oct 13, 2020
@dereckson dereckson reopened this Oct 13, 2020
Copy link
Member

@dereckson dereckson left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@@ -31,7 +31,7 @@ initialize_data_dir() {
if [[ ! -d "${OPENFIRE_DATA_DIR}/conf" ]]; then
sudo -HEu "${OPENFIRE_USER}" cp -a /etc/openfire "${OPENFIRE_DATA_DIR}/conf"
fi
sudo -HEu "${OPENFIRE_USER}" mkdir -p "${OPENFIRE_DATA_DIR}/{plugins,embedded-db}"
sudo -HEu "${OPENFIRE_USER}" mkdir -p "${OPENFIRE_DATA_DIR}"/{plugins,embedded-db}
Copy link
Member

Choose a reason for hiding this comment

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

Oh nice catch.

Summary:
To allow spaces in variables like OPENFIRE_DATA_DIR, they have been enclosed
in quotes.

As the expression uses GNU coreutils mkdir {} syntax, put the {} in quotes
has broken the directory creation: instead to create /path/to/openfire/plugins
and /path/to/openfire/embedded-db, it created the exact quoted content.

That breaks new installations when directories don't exist.

This change fixes that regression. This is a follow-up for e76b3cf.

Test Plan:
```
$ export OPENFIRE_DATA_DIR=/tmp/openfire
$ mkdir -p "${OPENFIRE_DATA_DIR}"/{plugins,embedded-db}
$ ls $OPENFIRE_DATA_DIR
embedded-db  plugins
```

Reviewers: dereckson

Reviewed By: dereckson

Differential Revision: https://devcentral.nasqueron.org/D2372
@dereckson
Copy link
Member

dereckson commented Oct 14, 2020

Thanks for this correction, that indeed broke the image when not an update.

In October, there is the hacktoberfest with the challenge to submit 4 pull requests to various GitHub repositories.

If you want to participate and get a t-shirt or plant a tree, make 3 more contributions to any project :) More information at
https://hacktoberfest.digitalocean.com/

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.

2 participants