 Hey guys, you may have heard about system D and system D is that the heart of your Linux system And it's responsible for the initialization of your system management of various resources like demons Processes paths and more now how you interface with it is by using the system CTL command and then you would refer to a unit Now a unit is an aspect of the system that system D manages and we have various types of units We have service units that are used for demons. We have socket units for TCP ports We have path units to manage files and directories. We have target units as well, which are groups of other units Now every unit is represented by a unit file that has its configuration Now to list the different unit files that we have we can make use of the command system CTL And we could say list unit files and again take advantage of tab completion over here So we're gonna do a list for unit files and you can see these are the different unit files that we have Now the extension typically is indicative of the type of unit that we are dealing with over here So you can see that we have things like mounts. We have auto mounts. We have paths services Those are big ones. We deal with them quite frequently Scrolling down in the list over here. Yeah, lots of services as you can see but they also others like sockets So you can see that we have a cockpit dot socket right now and then further towards the bottom You can see targets like I said think of a target as being a group of other units Now typically to do management of services again, we would make use of System CTL if we wanted to display units of a particular type we could say system CTL and we could say list units So we're gonna be listing the units of a particular type So now we could say dash dash type and we could specify the type that we're interested in So we could say service and it's only gonna show us unit types or unit files of the type service right now So again, you can see we have a couple of components over here. Let's go and scroll down through the list Yeah, the big one that we're gonna deal with is a SSHD dot service So let's go and run that system CTL command to have a look at the status of the SSHD service So the command right now becomes system CTL status SSHD Now what I could do is specify the full name of the unit including the the extension So I could say SSHD dot service and that's completely optional the command would work without it So it would yield the same result So what we can see right now is that we are having a look at the units Called SSHD dot service, which is for the open SSH server demon You could see that its unit file is loaded and you can see the path that the unit file comes from So this unit file comes from US RLIB system D system SSHD dot service and like I said, it's a configuration file It's currently enabled and what this means is that whenever the system boots up that unit file is gonna be initialized That service in other words is going to be started and you can see that the vendors preset behavior is for it to be enabled at the moment It's currently running so we could see it's active status over there It's currently running right now and you can see since when since Wednesday April the 17th It also gives us some really cool information about the applicable documentation that you may be interested in So it's referring us over here to man pages. We can see the main process idea as well We can see the the tasks the memory We can see something about C groups or control groups and yet we have some basic logging information That is displayed over here. Now what I'm gonna do is that I'm gonna go along and I'm gonna restart SSHD so to do that I'm gonna say system CTL restart SSHD now and I want you to just to be mindful of the main process ID over there at 7 2 8 So let's go and restart SSHD and now we're gonna have a look at these status once again So when you use the restart command against a service unit file What's gonna happen is that the the service would be stopped and it would be started again And this means that it would get a brand new process ID as opposed to doing a reload operation So let's go and try the reload operation So again, let's just remind ourselves that the main process ID right now is 1391 So we're gonna say system CTL reload SSHD dot service and again the dot service is completely optional I've got there that quickly because I use tab completion So let's go and have a look at the stages one more time and guys What we can see over here is that the main process ID has remained the same now the reason why you may want to do a reload of a service is that You may have changed the configuration file that is associated with that service So let's just say you come along and you want to change how your how your service behaves You've changed the configuration file. You see when that service initially started I took the configuration file from the file system and it put it into memory And now it uses the version of the configuration file from memory Now in the meantime, what you've come along and done is that you've edited the configuration file on the file system Now in order to get those changes to be used by your service What we need to do is that we need to tell the service to go and reload its configuration file So when we said system CTL reload, we told the service. Hey service Dump your configuration file that you are making use of right now go and reload the configuration file from the file system into memory And now it would use that newly modified version Now what you did when you did a restart is that you terminated the service And when you terminate the service or when you stop the service it would dump its configuration file Which is in memory then the restart action would result in the service being started up again And like I said when a service starts up It would go and load its configuration file from the file system Load it up into memory and now it would use the version of the configuration file that is in memory So some of the more basic tasks that you need to be familiar with is how you would go about Starting a service and how you would go about enabling the persistent starting of a service So to do that you would say system CTL and you would say start and you would specify the service by name So I would go and say something like SSHD if you want to make sure that the service is persistently enabled You would say system CTL enable SSHD and that will make sure that whenever your your system boots up whenever system D-initializes that SSHD is enabled it is started so looking at the status of it you guys you could see that it's active It's running and should I start reboot the system? It will be started again automatically for me So again, these are some of the more basic things that you need to be mindful of when working with system D And system CTL in particular is your interface. It's your gateway into Operations in the world of system D. So with that guys, we're gonna bring things to a close over here I will see you in the next video