WEBVTT

00:04.530 --> 00:09.300
With our custom build of engineers working and listening on h.t. to be port 80.

00:09.300 --> 00:13.460
The next step is configuring a system service for engine X..

00:13.470 --> 00:19.350
More specifically we'll be adding engine X as a system D service the newer and more popular standard

00:19.350 --> 00:20.830
for services.

00:20.860 --> 00:27.510
Now before we continue note that system D is only available since a boon to fifteen point zero 4 and

00:27.520 --> 00:29.100
sentence 7.

00:29.220 --> 00:34.440
If you're using an old operating system you can refer to the archive section of this course for a detailed

00:34.440 --> 00:40.530
guide to creating an init service creating an engine x service will not only allow us to manage starting

00:40.530 --> 00:46.870
stopping and reloading in generics in a more standardized way but also make starting engine X on boot.

00:46.890 --> 00:49.520
Much simpler before we start over.

00:49.530 --> 00:56.070
Let's quickly see how to use the standard engine X command line tools to execute service signals.

00:56.070 --> 01:00.290
We can again confirm that engine exists running by checking for the process.

01:00.420 --> 01:01.610
We see it there.

01:01.710 --> 01:08.590
The master and worker process check back in the browser and the holding page the loads as expected.

01:08.640 --> 01:13.890
So with engine X running in the background let's see how to sended a stop signal using the standard

01:13.890 --> 01:15.390
command line tools.

01:15.570 --> 01:21.990
We can get a full list of available commands with the H flag for help version and configuration options

01:21.990 --> 01:23.910
as we saw in the previous lesson.

01:24.030 --> 01:29.690
A command for testing the configuration syntax and most importantly the signal command.

01:29.790 --> 01:35.040
This being the command with which we can send signals or instructions to the background process.

01:35.040 --> 01:43.110
For example with engine X running we can send the stop signal with engine X s flag for signal stop check

01:43.110 --> 01:44.360
the process again.

01:45.150 --> 01:45.970
Nothing.

01:46.140 --> 01:51.200
Reload the browser unable to connect as engine Xist now stopped.

01:51.210 --> 01:53.790
Or more accurately terminate it.

01:53.790 --> 01:56.870
There's not much more to the standard command line tools.

01:56.910 --> 02:03.450
So next lets add that system D service to enable the service we're going to have to add a small script

02:03.900 --> 02:09.350
which being the same across operating systems we can simply copy from the engine X website.

02:09.480 --> 02:15.900
The page we are looking for is the engine X init scripts ressource page this time on engine X dot com

02:16.440 --> 02:19.560
again linked in the list and resources we have here.

02:19.560 --> 02:25.080
The old init scripts which as mentioned you can find a lesson on in the archive section of the Course

02:25.230 --> 02:26.060
she Jeff to use.

02:26.080 --> 02:34.800
That and a bit further down system de navigate to the example serve as file which is the script here

02:35.250 --> 02:37.350
and in the instructions we see the location.

02:37.350 --> 02:39.270
This file needs to exist in.

02:40.040 --> 02:41.680
I'll copy this location.

02:42.480 --> 02:47.610
Create that file in the given location and add the script contents.

02:47.840 --> 02:51.350
I am simply going to use the built in n.a. Editor for this.

02:51.510 --> 02:54.930
No no that new file which is empty of course.

02:54.930 --> 02:58.660
So copy the system D serve a script from that example by H.

03:00.310 --> 03:01.080
Haste.

03:01.510 --> 03:07.150
And now notice that a couple of these sittings will have to be changed to match our injured configuration

03:07.690 --> 03:10.040
starting with the p I define location.

03:10.060 --> 03:17.850
As we sit in the configuration step prior to building the engine X source slash var run engine Exon

03:17.870 --> 03:26.200
be idae and our engine X executable or esben path were simply user burn in generics.

03:26.410 --> 03:29.290
So change both occurrences of those.

03:29.290 --> 03:34.810
This first one being the pre start command for checking the engineer syntax and the second the actual

03:34.810 --> 03:36.430
start command.

03:36.430 --> 03:37.780
That's all we need to change.

03:37.810 --> 03:40.590
So save the file with control oh.

03:40.930 --> 03:45.100
Confirm and control x to exit the editor.

03:45.220 --> 03:47.910
That's all there is to configuring the servers for engine X..

03:47.980 --> 03:51.180
So lets start engine X back up using System D.

03:51.220 --> 03:58.360
This time of khelil this run system C T L being the system D command.

03:58.600 --> 04:02.180
Start engine x no errors.

04:02.200 --> 04:04.270
So check the process exists.

04:05.190 --> 04:05.960
And there we have it.

04:05.970 --> 04:12.240
Engine X is up and running but with our system D service enabled we can now also check engine access

04:12.250 --> 04:21.120
status using System D instead of the process command again system C T L status in generics which gives

04:21.120 --> 04:27.210
us this really informative printout of the engine X server status system resources currently being used

04:27.210 --> 04:30.630
by engineers and the last few log messages.

04:30.630 --> 04:34.560
So already a much better way of managing the engineer service.

04:34.560 --> 04:38.100
Check back in the browser and the holding pages back.

04:38.100 --> 04:43.590
Stop it again this time with System C D L stop in generics.

04:46.200 --> 04:47.410
And Dell.

04:47.690 --> 04:52.800
Now as I mentioned the other very useful feature of a system D service is an ailing engine XT you start

04:52.860 --> 04:58.590
automatically when the system boots at the moment when this machine is shut down or reboot it.

04:58.600 --> 05:00.440
Engineers will no longer be running.

05:00.540 --> 05:03.530
Obviously not good for a web server in particular.

05:03.570 --> 05:05.820
So to an able start up on boot.

05:05.850 --> 05:10.520
We can run system C T L N able in Genex.

05:10.530 --> 05:12.560
This of course being a one self-command.

05:12.750 --> 05:17.750
So we get confirmation of a start up simulink being created for this service.

05:17.940 --> 05:21.530
We can test this by rebooting the machine reboot.

05:21.780 --> 05:24.750
I'll fast forward through this so we can connect back.

05:26.580 --> 05:33.270
Ubuntu machine is back up and running so check the engine status and we have confirmation engine X is

05:33.270 --> 05:39.380
running and should be listening on port 80 confirm in the browser and the holding page lote.
