cptactionhank / docker-atlassian-jira

Atlassian JIRA Core wrapped in a Docker image
https://cptactionhank.github.io/docker-atlassian-jira
MIT License
621 stars 248 forks source link

Remove lockfile in home directory on startup #85

Open bradjones1 opened 5 years ago

bradjones1 commented 5 years ago

When a pod is killed, Jira doesn't clean up its lock file in the home directory. Atlassian's own documentation (well, blog post) shows a bootstrap script that removes the existing lock file, if found. Should we do the same here?

bradjones1 commented 5 years ago

I'm accomplishing this with an init container for the moment, however it seems like this would be appropriate in the entrypoint script, as well.

Alwandy commented 5 years ago

Same issue..., what I did is I created another script that tries to find .lock file and if found it deletes then runs the startup process. Sound similar to you @bradjones1 ?

bradjones1 commented 5 years ago

@Alwandy The official K8s way of doing this would be to use an init container to do what you just described, then run the application. It would be good to include that logic inside this image directly, but an init container allows you to run your setup tasks (like deleting the lock file) without having to build your own image just to add a line to the entrypoint script.

Alwandy commented 5 years ago

@bradjones1 thanks, what I did is just do this for docker: # Delete .lock before launching JIRA again (USING SED) RUN sed --in-place '1 a rm -f /var/atlassian/jira/.jira-home.lock;' /opt/atlassian/jira/bin/start-jira.sh

I hope this can be prioritised in any way...