Properly shut down Discourse when host shuts down

About a year ago, @tobiaseigen asked how to properly shut down Discourse:

The conclusion was that a ./launcher stop app should now suffice. This is great, but it still is a separate step. It won’t help you if another sysadmin shuts down your system, or if unattended-upgrades decides that a reboot is due now.

Is there a way (on Ubuntu) to ensure that Discourse always shuts down properly if the system is rebooted?

Discourse data is written to the host, so whatever has been written, will survive.
Unless you’re on a very busy Discourse instance, I would say you could simply shutdown now.

On a very busy Discourse instance, I’d stop Nginx and DB (in Docker) manually, then shutdown the app and OS. I’d probably make a script that runs these steps and you can do the same (sudo ./shtudown-docker.sh isn’t that hard).

Shutdown is safe, we have a shutdown sequence that docker triggers when stopped

5 Likes

I know – but this doesn’t protect against other sysadmins or unattended-upgrades :smile:

This is great news. Thanks!

You can disable unattended upgrades (on the OS level).
And you could insert those steps in the system shutdown script.
But Sam said they did that inside of the docker script.

This topic was automatically closed after 3160 days. New replies are no longer allowed.