With our custom build of engineers working and listening on h.t. to be port 80.
The next step is configuring a system service for engine X..
More specifically we'll be adding engine X as a system D service the newer and more popular standard
for services.
Now before we continue note that system D is only available since a boon to fifteen point zero 4 and
sentence 7.
If you're using an old operating system you can refer to the archive section of this course for a detailed
guide to creating an init service creating an engine x service will not only allow us to manage starting
stopping and reloading in generics in a more standardized way but also make starting engine X on boot.
Much simpler before we start over.
Let's quickly see how to use the standard engine X command line tools to execute service signals.
We can again confirm that engine exists running by checking for the process.
We see it there.
The master and worker process check back in the browser and the holding page the loads as expected.
So with engine X running in the background let's see how to sended a stop signal using the standard
command line tools.
We can get a full list of available commands with the H flag for help version and configuration options
as we saw in the previous lesson.
A command for testing the configuration syntax and most importantly the signal command.
This being the command with which we can send signals or instructions to the background process.
For example with engine X running we can send the stop signal with engine X s flag for signal stop check
the process again.
Nothing.
Reload the browser unable to connect as engine Xist now stopped.
Or more accurately terminate it.
There's not much more to the standard command line tools.
So next lets add that system D service to enable the service we're going to have to add a small script
which being the same across operating systems we can simply copy from the engine X website.
The page we are looking for is the engine X init scripts ressource page this time on engine X dot com
again linked in the list and resources we have here.
The old init scripts which as mentioned you can find a lesson on in the archive section of the Course
she Jeff to use.
That and a bit further down system de navigate to the example serve as file which is the script here
and in the instructions we see the location.
This file needs to exist in.
I'll copy this location.
Create that file in the given location and add the script contents.
I am simply going to use the built in n.a. Editor for this.
No no that new file which is empty of course.
So copy the system D serve a script from that example by H.
Haste.
And now notice that a couple of these sittings will have to be changed to match our injured configuration
starting with the p I define location.
As we sit in the configuration step prior to building the engine X source slash var run engine Exon
be idae and our engine X executable or esben path were simply user burn in generics.
So change both occurrences of those.
This first one being the pre start command for checking the engineer syntax and the second the actual
start command.
That's all we need to change.
So save the file with control oh.
Confirm and control x to exit the editor.
That's all there is to configuring the servers for engine X..
So lets start engine X back up using System D.
This time of khelil this run system C T L being the system D command.
Start engine x no errors.
So check the process exists.
And there we have it.
Engine X is up and running but with our system D service enabled we can now also check engine access
status using System D instead of the process command again system C T L status in generics which gives
us this really informative printout of the engine X server status system resources currently being used
by engineers and the last few log messages.
So already a much better way of managing the engineer service.
Check back in the browser and the holding pages back.
Stop it again this time with System C D L stop in generics.
And Dell.
Now as I mentioned the other very useful feature of a system D service is an ailing engine XT you start
automatically when the system boots at the moment when this machine is shut down or reboot it.
Engineers will no longer be running.
Obviously not good for a web server in particular.
So to an able start up on boot.
We can run system C T L N able in Genex.
This of course being a one self-command.
So we get confirmation of a start up simulink being created for this service.
We can test this by rebooting the machine reboot.
I'll fast forward through this so we can connect back.
Ubuntu machine is back up and running so check the engine status and we have confirmation engine X is
running and should be listening on port 80 confirm in the browser and the holding page lote.