Running a background process in Linux
While running things from the command line is great, sometimes you want it to run without your intervention. These may be things such as listening services, database engines, or VNC servers that you want to be continuously available but not sitting open in one of your terminal windows. In this recipe, we will look at how to manipulate these services and assess their current status.
Getting ready
There is nothing you need to add for this recipe; we're going to leverage systemctl
, a common daemon for managing background services. We're going to make sure our PostgreSQL database starts after a reboot; if you haven't installed PostgreSQL yet, you can do that with this command:
sudo apt-get install postgresql
How to do it...
There are plenty of services that you want to count on starting up automatically after an unexpected reboot, crash, or power loss. If you are hosting a database, its service is usually one that you want to start any time your system does...