1
00:00:00,000 --> 00:00:02,070
The version of Linux that we use

2
00:00:02,070 --> 00:00:05,850
manage the system by using the system D utility.

3
00:00:05,850 --> 00:00:06,683
Now in particular,

4
00:00:06,683 --> 00:00:09,360
it's going to use the system control command,

5
00:00:09,360 --> 00:00:10,320
and that's going to allow us

6
00:00:10,320 --> 00:00:13,800
to start, stop, restart, view all the different services

7
00:00:13,800 --> 00:00:15,810
that are running on the system.

8
00:00:15,810 --> 00:00:18,150
Now, older systems use SysVinit.

9
00:00:18,150 --> 00:00:21,420
That's been largely replaced by system D.

10
00:00:21,420 --> 00:00:23,880
So we're going to go through the process and just go

11
00:00:23,880 --> 00:00:28,470
over a few commands, few processes, how to manage them,

12
00:00:28,470 --> 00:00:30,990
what type of configuration files that are required

13
00:00:30,990 --> 00:00:32,460
for these services to start,

14
00:00:32,460 --> 00:00:35,100
from initial boots and how to switch in,

15
00:00:35,100 --> 00:00:37,233
and out different configuration settings.

16
00:00:38,130 --> 00:00:39,090
So let's go get started here.

17
00:00:39,090 --> 00:00:40,035
First thing we want to do,

18
00:00:40,035 --> 00:00:42,090
we want to use the process command.

19
00:00:42,090 --> 00:00:44,100
Now, we want to see everything that's running.

20
00:00:44,100 --> 00:00:45,873
So we're going to use process dash E.

21
00:00:46,980 --> 00:00:51,980
You can go pipe it in the search for the init command.

22
00:00:53,760 --> 00:00:56,790
Now, we're looking for the init command only by itself,

23
00:00:56,790 --> 00:00:57,623
'cause that will indicate

24
00:00:57,623 --> 00:01:00,390
that we're using the system Vinit,

25
00:01:00,390 --> 00:01:01,800
and that's the older version.

26
00:01:01,800 --> 00:01:04,533
But what we're going to do is look for the system MD now.

27
00:01:08,610 --> 00:01:10,800
And that should be number one.

28
00:01:10,800 --> 00:01:11,633
Okay?

29
00:01:11,633 --> 00:01:12,750
So since that's process number one,

30
00:01:12,750 --> 00:01:15,390
we realize that, that's the service

31
00:01:15,390 --> 00:01:17,760
that's going to start all other services.

32
00:01:17,760 --> 00:01:19,770
And again, that initializes our services.

33
00:01:19,770 --> 00:01:22,320
Start, stops and pulls different resources

34
00:01:22,320 --> 00:01:24,360
in order to fulfill the requirements

35
00:01:24,360 --> 00:01:26,370
of the services beneath them.

36
00:01:26,370 --> 00:01:27,203
Okay?

37
00:01:27,203 --> 00:01:29,460
Now, let's go ahead and check the configuration files.

38
00:01:29,460 --> 00:01:32,520
Now, and specifically we're going to view the target files

39
00:01:32,520 --> 00:01:34,500
that specify the services that will start

40
00:01:34,500 --> 00:01:35,460
when the system starts.

41
00:01:35,460 --> 00:01:36,390
Okay?

42
00:01:36,390 --> 00:01:39,840
So first thing we want to look at is the multi-user target.

43
00:01:39,840 --> 00:01:41,130
And now this one's mostly going to focus

44
00:01:41,130 --> 00:01:44,283
on the command line only interface for the system.

45
00:01:45,180 --> 00:01:46,830
So let's look that up real quick.

46
00:01:51,805 --> 00:01:54,030
Now, if you look, this is a file that gives us

47
00:01:54,030 --> 00:01:56,520
general information about this target.

48
00:01:56,520 --> 00:01:59,550
What we're going to key in on is the unit section,

49
00:01:59,550 --> 00:02:01,440
the description but we're going to focus

50
00:02:01,440 --> 00:02:03,870
on the requires field.

51
00:02:03,870 --> 00:02:07,170
And you see it requires the basic.target process

52
00:02:07,170 --> 00:02:09,990
to be running before it can start.

53
00:02:09,990 --> 00:02:12,660
Now, the basic.target process starts a lot

54
00:02:12,660 --> 00:02:14,790
of different services that are required,

55
00:02:14,790 --> 00:02:16,830
and it pulls together those different resources

56
00:02:16,830 --> 00:02:19,430
that gets the system established and up and running.

57
00:02:21,690 --> 00:02:23,190
Okay, let's just use the same thing,

58
00:02:23,190 --> 00:02:25,940
but now let's look at the graphical user interface one.

59
00:02:29,310 --> 00:02:31,230
Okay, and we'll focus on the requires,

60
00:02:31,230 --> 00:02:32,400
and we say we use them,

61
00:02:32,400 --> 00:02:34,560
we need the multi-user target first,

62
00:02:34,560 --> 00:02:37,923
up and running before we can process the graphical target.

63
00:02:38,790 --> 00:02:40,620
And you see the wants display,

64
00:02:40,620 --> 00:02:42,752
again, that's saying, "In order for this process to run,

65
00:02:42,752 --> 00:02:45,270
we're going to require the display manager."

66
00:02:45,270 --> 00:02:47,790
And again, this is a graphical user interface target.

67
00:02:47,790 --> 00:02:49,890
So that means we're going to have to initialize all

68
00:02:49,890 --> 00:02:52,410
of the devices and resources that are required

69
00:02:52,410 --> 00:02:55,740
to get the display up and running.

70
00:02:55,740 --> 00:02:59,070
This shows how these processes build upon one another.

71
00:02:59,070 --> 00:03:00,300
One requires another,

72
00:03:00,300 --> 00:03:02,700
so that's why the system D starts first,

73
00:03:02,700 --> 00:03:04,563
and it bootstraps everything else.

74
00:03:05,430 --> 00:03:07,200
So now we're going to use the system control,

75
00:03:07,200 --> 00:03:11,874
which is used to manage the system D utility.

76
00:03:11,874 --> 00:03:13,530
And we're going to get a view of all the services

77
00:03:13,530 --> 00:03:15,580
that are currently running in the system.

78
00:03:18,720 --> 00:03:20,823
Type, it's going to equal service.

79
00:03:21,660 --> 00:03:23,430
Okay, now this a list of every service

80
00:03:23,430 --> 00:03:25,743
that's currently running in the Linux system.

81
00:03:27,660 --> 00:03:29,910
Okay, now, if you look at the bottom,

82
00:03:29,910 --> 00:03:32,910
just indicates what those fields mean.

83
00:03:32,910 --> 00:03:34,170
So the low reflects

84
00:03:34,170 --> 00:03:36,510
whether the unit definition's proper loaded,

85
00:03:36,510 --> 00:03:39,330
active SUB, just further clarifying the status

86
00:03:39,330 --> 00:03:42,063
of each one of those services in this particular view.

87
00:03:44,610 --> 00:03:46,050
Now, we're going to go ahead and switch

88
00:03:46,050 --> 00:03:48,840
to the multi-user target really quick,

89
00:03:48,840 --> 00:03:51,060
and then we're going to switch to the graphical target,

90
00:03:51,060 --> 00:03:51,893
'cause remember,

91
00:03:51,893 --> 00:03:53,940
in order to even get to the graphical target,

92
00:03:53,940 --> 00:03:56,523
we have to go to the multi-user target first.

93
00:03:57,630 --> 00:03:59,940
Okay, so let's switch to the multi-user target,

94
00:03:59,940 --> 00:04:01,640
and see how the environment looks.

95
00:04:04,140 --> 00:04:05,080
System control

96
00:04:06,810 --> 00:04:07,643
isolate.

97
00:04:12,330 --> 00:04:14,880
All right, and again, this looks very familiar,

98
00:04:14,880 --> 00:04:18,526
but initially we defaulted into a graphical user interface,

99
00:04:18,526 --> 00:04:20,279
and then switched to a terminal.

100
00:04:20,279 --> 00:04:22,500
With this particular type of target,

101
00:04:22,500 --> 00:04:25,470
we go straight into command line and that is it.

102
00:04:25,470 --> 00:04:26,613
So let me log in.

103
00:04:29,280 --> 00:04:30,113
All right.

104
00:04:33,780 --> 00:04:37,290
Again, now, this is going to be a light version of the system,

105
00:04:37,290 --> 00:04:38,720
pretty much where we're not using it

106
00:04:38,720 --> 00:04:40,410
in the graphical user interface.

107
00:04:40,410 --> 00:04:42,540
So the system should run more efficiently,

108
00:04:42,540 --> 00:04:44,790
since all these services aren't being needed.

109
00:04:46,410 --> 00:04:51,273
Okay, now, let's switch to the system control isolate,

110
00:04:52,410 --> 00:04:55,830
and we're going to use the go back to the graphical target.

111
00:04:55,830 --> 00:04:56,663
Okay.

112
00:05:02,850 --> 00:05:06,060
And we see we're back to a more familiar setting.

113
00:05:06,060 --> 00:05:06,893
Okay?

114
00:05:06,893 --> 00:05:08,370
I'm going to here.

115
00:05:08,370 --> 00:05:10,110
Next, we're going to go ahead and go just change

116
00:05:10,110 --> 00:05:11,910
the default to this target,

117
00:05:11,910 --> 00:05:13,620
even though it's already set this way.

118
00:05:13,620 --> 00:05:16,020
Just going to demonstrate how to do that.

119
00:05:16,020 --> 00:05:18,243
Okay, let's do sudo, system control.

120
00:05:21,570 --> 00:05:22,860
Okay, now let's end this.

121
00:05:22,860 --> 00:05:24,240
Whenever we first log into the system,

122
00:05:24,240 --> 00:05:27,040
we're going to go into this target that we're currently in.

123
00:05:28,200 --> 00:05:29,033
Just want to check out some

124
00:05:29,033 --> 00:05:30,753
of the system control sub commands.

125
00:05:31,800 --> 00:05:33,630
And again, we can use that double tab,

126
00:05:33,630 --> 00:05:35,580
and it's gon' let us know everything we can do,

127
00:05:35,580 --> 00:05:37,470
all these sub commands that are available

128
00:05:37,470 --> 00:05:38,730
when you're using the system D,

129
00:05:38,730 --> 00:05:41,013
or AKA system control command.

130
00:05:41,880 --> 00:05:44,040
So in particular, we're going to note the start,

131
00:05:44,040 --> 00:05:47,130
stop and restart sub commands,

132
00:05:47,130 --> 00:05:48,840
'cause we're going to use those very frequently

133
00:05:48,840 --> 00:05:51,150
as Vinit system administrators.

134
00:05:51,150 --> 00:05:53,910
So let's go ahead and practice on a particular service.

135
00:05:53,910 --> 00:05:55,050
And one thing that we're going to look

136
00:05:55,050 --> 00:05:57,930
at is the SSH Daemon service.

137
00:05:57,930 --> 00:05:59,410
Okay, so we're going to do sudo.

138
00:06:05,007 --> 00:06:06,220
The status of

139
00:06:08,050 --> 00:06:09,633
the SSH Daemon service.

140
00:06:11,220 --> 00:06:12,053
All right.

141
00:06:12,053 --> 00:06:14,130
So we'll see that's up and running for us.

142
00:06:14,130 --> 00:06:15,000
This is a quick way again,

143
00:06:15,000 --> 00:06:16,890
to get the status of a service,

144
00:06:16,890 --> 00:06:18,810
and we can use any service in the scenario.

145
00:06:18,810 --> 00:06:21,325
So we can go through and actually stop this service.

146
00:06:21,325 --> 00:06:22,230
And we're going to bring that status up again,

147
00:06:22,230 --> 00:06:23,480
see what that looks like.

148
00:06:25,980 --> 00:06:27,720
Okay, now, we see the active status

149
00:06:27,720 --> 00:06:29,883
just went to inactive or dead.

150
00:06:30,930 --> 00:06:32,253
Okay, I'll re-enable that.

151
00:06:37,380 --> 00:06:40,200
Check the status, back to green.

152
00:06:40,200 --> 00:06:41,790
Easy enough.

153
00:06:41,790 --> 00:06:43,200
Again, I'm going to try one last one.

154
00:06:43,200 --> 00:06:47,703
It's going to be the firewall for low practice.

155
00:06:54,570 --> 00:06:56,700
Okay, we see it's actually inactive.

156
00:06:56,700 --> 00:06:58,850
So we'll go ahead and start the service up.

157
00:07:05,460 --> 00:07:06,690
Okay.

158
00:07:06,690 --> 00:07:07,890
See it's up and running.

159
00:07:09,180 --> 00:07:13,020
So we're going to explore the enable and disable command.

160
00:07:13,020 --> 00:07:15,990
And those reference the status of this service

161
00:07:15,990 --> 00:07:17,430
when the system reboots.

162
00:07:17,430 --> 00:07:19,263
If we look at again, really quick,

163
00:07:22,920 --> 00:07:23,753
we see it's active.

164
00:07:23,753 --> 00:07:25,120
Now, we're going to change this.

165
00:07:26,400 --> 00:07:28,623
We're going to disable this service.

166
00:07:29,610 --> 00:07:34,610
And so when it first starts up, it should be disabled.

167
00:07:35,280 --> 00:07:36,330
So it's going to reboot.

168
00:07:48,360 --> 00:07:51,183
Okay, let's check out the system control status.

169
00:07:58,350 --> 00:08:01,143
Okay, so we see it's now no longer running.

170
00:08:02,340 --> 00:08:04,140
But again, that's a key service that we need,

171
00:08:04,140 --> 00:08:05,840
so let's make sure we enable this,

172
00:08:09,180 --> 00:08:11,223
as well as starting this service.

173
00:08:14,160 --> 00:08:14,993
Okay.

174
00:08:20,460 --> 00:08:22,680
Looks like we're all good to go there.

175
00:08:22,680 --> 00:08:23,820
Well, that sums this lesson up.

176
00:08:23,820 --> 00:08:26,490
We went through how to use the system control,

177
00:08:26,490 --> 00:08:29,220
which is a utility of system D

178
00:08:29,220 --> 00:08:33,030
to monitor start, stop and change statuses

179
00:08:33,030 --> 00:08:35,100
of different processes and services

180
00:08:35,100 --> 00:08:37,080
that are running on a Linux system.

181
00:08:37,080 --> 00:08:38,880
And I'll see you in the next lesson.

