-
-
Notifications
You must be signed in to change notification settings - Fork 610
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
docs: fix systemd unit example for casual hosting #5876
docs: fix systemd unit example for casual hosting #5876
Conversation
Thanks for this! I'll look forward to trying it on my own little VM that runs the little sites I maintain. |
@vanWittlaer do you have a link to add about how you learned this? Please edit the PR to add it, thanks! |
@rfay Thx for the hint - updated the PR description - is that what you meant? |
Thanks for the update. I was also hoping for a link to Debian/Ubuntu/Systemd docs (at least in the PR description here) that explain how this works and perhaps why we should use this approach. |
Links added to description. |
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.
Very nice. I was able to actually watch it happen after sudo reboot
. That kicked me out right away but then ssh <host>
and ddev list
and I could see it bringing down each project.
Thanks for all the work on this! How is it working for you?
Hi @rfay thanks for merging, and for all the discussions and thoughts on this. Amazing you could reproduce it, must be a matter of milliseconds I thought. Anyway, looks to be stable now on my server. |
It takes 10 seconds or more to Thanks for all your work on this! |
The Issue
During shutdown of a Linux host, the
ddev poweroff
triggered in theExecStop=
directive of the provided sample systemd unit file left containers dangling around. This may result in file permission conflict, if a custom mySQL config file is provided.How This PR Solves The Issue
Changes the
After=
from network.target to multi-user.target, which is fired later on startup and thus ExecStop= will be fired earlier on shutdown, leaving ddev poweroff more time to properly clean up.Compare the traces from the
systemd-analyze critical-chain ddev.service
for the alternate settings:In particular the containerd.service and docker.service are required up prior to start of ddev.service, and in turn required to stay up until stop of ddev.service.
For more details see:
Manual Testing Instructions
Setup a Ubuntu server, setup a ddev project with a custom mySQL file, restart server with
shutdown -r 0
.Automated Testing Overview
Related Issue Link(s)
Release/Deployment Notes