• Servers and Tools

Introduction and Setup

From the class:  Managing Processes with systemd

In this class, I'm going to be showing you around a program called systemd. It's installed by default on Ubuntu and a lot of other Linux systems. And it allows us to manage our processes, our user processes, those are ones that we run on the operating system.

It does an awful lot of stuff. So if you're to scroll down this Wiki page, for example, you can see a little diagram here that shows you a bunch of all the different utilities and things that it does. But we're going to focus in this class on two key features of systemd.

First is how it allows us to manage processes, start them, stop them, reload them. And also how we can use its logging feature to get really cool logs. systemd will be really important when we start setting up our own deployment environments because we're not going to want to start these processes manually. We're going to want to have it managed by something so that, for example, if they die, they're restarted automatically and so that we have a consistent way of working with processes on the system.

Let's get set up for this class in case you want to follow along. As always down in the materials section, you'll find the source code. And that's where you can find the Vagrant file and the source code folder for this project. And if you clone that repository, you should have the same environment that I have.

And while we're over here, I always appreciate it if you enjoy one of the lessons if you're able to share it with your friends and talk a little bit about what you learned. It's really helpful for me to get some new users. So thanks ahead of time if you do that.

And I'll try to put any prerequisites that you may need here. I don't think that you're going to need too much. But for example, the processes class and the shell class would be useful to understand some of the things that are going on. So let's head over to the terminal and get Vagrant up and running.

Once you clone the repository, the project folder should look something like this. And you can type Vagrant up in order to start up the virtual machine. And once it's booted, type vagrant ssh to ssh into it. If you want to go to this folder, our project folder, it's automatically shared. And we can find it in the /vagrant directory.

So notice if I list out the contents of this directory, it's the same as our project up here. And that's because this folder is automatically shared for us by the Vagrant software. So that's all you need. And, again, you can exit out of Vagrant this way. And now we're back in our Mac terminal.