By rysilva
I recently realized my site was down, and after I checked the logs I noticed I couldn’t connect to postgres. Once I started postgres the site was back up.
Couple of questions:
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello there,
The best place to start is to check the server logs. This can shed more light on why the service was stopped.
You can create a simple script to check if Postgresql is running and if not to start the service.
- #!/bin/bash
-
- # Check if MySQL is running
- sudo systemctl status postgresql.service > /dev/null 2>&1
-
- # Restart the MySQL service if it's not running.
- if [ $? != 0 ]; then
- sudo systemctl start postgresql.service
- fi
Regards
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.