1 00:00:06,320 --> 00:00:10,950 - In this video, I want to explain Linux processes and jobs. 2 00:00:10,950 --> 00:00:14,190 Anything that runs on Linux runs as a process, 3 00:00:14,190 --> 00:00:17,550 and processes have a process ID, and they can be managed 4 00:00:17,550 --> 00:00:19,799 by sending signals to it. 5 00:00:19,799 --> 00:00:23,310 Signals are special operating system instructions. 6 00:00:23,310 --> 00:00:26,790 There is Sigterm, also known as Signal 15, 7 00:00:26,790 --> 00:00:30,161 which is a default signal that instructs a process to stop. 8 00:00:30,161 --> 00:00:32,850 There is Sigkill or Signal Nine, 9 00:00:32,850 --> 00:00:35,940 which is a signal to force a process to stop immediately. 10 00:00:35,940 --> 00:00:38,970 I'll tell you how to do that later in this lesson. 11 00:00:38,970 --> 00:00:40,260 Then there are jobs. 12 00:00:40,260 --> 00:00:42,450 Jobs are user processes that have been started 13 00:00:42,450 --> 00:00:44,400 from a specific shell. 14 00:00:44,400 --> 00:00:47,130 And the nice thing about jobs is that users can manage 15 00:00:47,130 --> 00:00:48,600 their own jobs. 16 00:00:48,600 --> 00:00:53,220 And all processes originate as child from systemd. 17 00:00:53,220 --> 00:00:56,073 Let me make a drawing to show you how this is organized. 18 00:00:57,990 --> 00:00:58,980 - In this video. 19 00:00:58,980 --> 00:01:00,570 I would like to explain a little bit 20 00:01:00,570 --> 00:01:04,830 about processes and how they are hierarchically organized. 21 00:01:04,830 --> 00:01:06,633 So it all starts with systemd. 22 00:01:07,590 --> 00:01:10,680 Systemd is PID One. 23 00:01:10,680 --> 00:01:12,660 It's a model of all processes. 24 00:01:12,660 --> 00:01:16,170 And you will notice that all other processes are a child 25 00:01:16,170 --> 00:01:17,970 of Systemd. 26 00:01:17,970 --> 00:01:22,890 You'll find kernel processes between square brackets. 27 00:01:22,890 --> 00:01:27,240 If you use a command like PSX, for instance, 28 00:01:27,240 --> 00:01:29,280 you'll find your service processes 29 00:01:29,280 --> 00:01:33,990 like your SSHD, and you'll find many, many more. 30 00:01:33,990 --> 00:01:38,703 And then at some point, there will be the gnome terminal. 31 00:01:39,930 --> 00:01:42,615 The gnome terminal is a process that is typically started 32 00:01:42,615 --> 00:01:45,330 for a graphical terminal. 33 00:01:45,330 --> 00:01:47,940 And as a child of this known terminal, 34 00:01:47,940 --> 00:01:51,540 there is bash, and bash is your shell. 35 00:01:51,540 --> 00:01:54,240 Now, if in this shell you are running commands, 36 00:01:54,240 --> 00:01:58,380 like a command, let's say, sleep 60, 37 00:01:58,380 --> 00:02:01,980 which will sleep for 60 seconds, 38 00:02:01,980 --> 00:02:03,960 or ls-l. 39 00:02:03,960 --> 00:02:08,640 All of these are children of the bash shell. 40 00:02:08,640 --> 00:02:10,440 They are a part of the process tree. 41 00:02:10,440 --> 00:02:12,810 And because they are a part of the process tree 42 00:02:12,810 --> 00:02:16,140 you can manage these as processes, 43 00:02:16,140 --> 00:02:19,680 but if they are your own, then these are the one 44 00:02:19,680 --> 00:02:22,680 that can also be managed as jobs. 45 00:02:22,680 --> 00:02:24,300 In the next couple of lessons, 46 00:02:24,300 --> 00:02:26,850 I will show you how to manage these processes 47 00:02:26,850 --> 00:02:28,173 as well as the jobs.