-
Notifications
You must be signed in to change notification settings - Fork 349
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:fix the manual delete servers.pid file after restart container #365
fix:fix the manual delete servers.pid file after restart container #365
Conversation
docker-entrypoint.sh
Outdated
if [ -f tmp/pids/server.pid ]; then | ||
rm tmp/pids/server.pid | ||
fi |
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.
This could just be:
rm -f tmp/pids/server.pid
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 @jakerenzella for you suggestion, it makes more sence and I have push the change.
Nice! This annoys me all the time |
@RayGuo-ergou I dont think the bundle exec is needed in the docker-entrypoint.sh as the CMD has this already. This will then also work if you want to run things outside of bundler. |
Hi @macite I have removed |
Do we need the entry point file at all then? |
@jakerenzella Good point, maybe we can just add the |
Yep 👍 keep it simple |
@RayGuo-ergou this looks good but just need to double check that rm -f always returns a truthy value even if there's no file, otherwise the proceeding statements won't run |
If not you can do rm -rf || command2 && command3 etc |
I tested to start the container when the server,pid file is deleted and it's running okay. Is that what you mean, sorry I am not very sure. |
This looks all good then :) |
Description
When we restart the doubtfire-api container, we need to delete the
server.pid
file in/tmp/pids
manually. So I added a docker entrypoint srcipt to delete that file everytime before the container start ifserver.pid
exist.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I build the docker image in my local dev environment, then develop the project with that image. To test it, I firstly went to the container bash, make sure the
server.pid
file is in the right path then I restart the container several times and restart my PC to test if we still need to deleteserver.pid
file manually. Also by monitoring the pids folder I can clearly see the file was removed then created when restart the container.Checklist: