Book Image

Raspberry Pi Zero Cookbook

Book Image

Raspberry Pi Zero Cookbook

Overview of this book

The Raspberry Pi Zero, one of the most inexpensive, fully-functional computers available, is a powerful and revolutionary product developed by the Raspberry Pi Foundation. The Raspberry Pi Zero opens up a new world for the makers out there. This book will give you expertise with the Raspberry Pi Zero, providing all the necessary recipes that will get you up and running. In this book, you will learn how to prepare your own circuits rather than buying the expensive add–ons available in the market. We start by showing you how to set up and manage the Pi Zero and then move on to configuring the hardware, running it with Linux, and programming it with Python scripts. Later, we integrate the Raspberry Pi Zero with sensors, motors, and other hardware. You will also get hands-on with interesting projects in media centers, IoT, and more.
Table of Contents (17 chapters)
Raspberry Pi Zero Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

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...