1 00:00:04,530 --> 00:00:09,300 With our custom build of engineers working and listening on h.t. to be port 80. 2 00:00:09,300 --> 00:00:13,460 The next step is configuring a system service for engine X.. 3 00:00:13,470 --> 00:00:19,350 More specifically we'll be adding engine X as a system D service the newer and more popular standard 4 00:00:19,350 --> 00:00:20,830 for services. 5 00:00:20,860 --> 00:00:27,510 Now before we continue note that system D is only available since a boon to fifteen point zero 4 and 6 00:00:27,520 --> 00:00:29,100 sentence 7. 7 00:00:29,220 --> 00:00:34,440 If you're using an old operating system you can refer to the archive section of this course for a detailed 8 00:00:34,440 --> 00:00:40,530 guide to creating an init service creating an engine x service will not only allow us to manage starting 9 00:00:40,530 --> 00:00:46,870 stopping and reloading in generics in a more standardized way but also make starting engine X on boot. 10 00:00:46,890 --> 00:00:49,520 Much simpler before we start over. 11 00:00:49,530 --> 00:00:56,070 Let's quickly see how to use the standard engine X command line tools to execute service signals. 12 00:00:56,070 --> 00:01:00,290 We can again confirm that engine exists running by checking for the process. 13 00:01:00,420 --> 00:01:01,610 We see it there. 14 00:01:01,710 --> 00:01:08,590 The master and worker process check back in the browser and the holding page the loads as expected. 15 00:01:08,640 --> 00:01:13,890 So with engine X running in the background let's see how to sended a stop signal using the standard 16 00:01:13,890 --> 00:01:15,390 command line tools. 17 00:01:15,570 --> 00:01:21,990 We can get a full list of available commands with the H flag for help version and configuration options 18 00:01:21,990 --> 00:01:23,910 as we saw in the previous lesson. 19 00:01:24,030 --> 00:01:29,690 A command for testing the configuration syntax and most importantly the signal command. 20 00:01:29,790 --> 00:01:35,040 This being the command with which we can send signals or instructions to the background process. 21 00:01:35,040 --> 00:01:43,110 For example with engine X running we can send the stop signal with engine X s flag for signal stop check 22 00:01:43,110 --> 00:01:44,360 the process again. 23 00:01:45,150 --> 00:01:45,970 Nothing. 24 00:01:46,140 --> 00:01:51,200 Reload the browser unable to connect as engine Xist now stopped. 25 00:01:51,210 --> 00:01:53,790 Or more accurately terminate it. 26 00:01:53,790 --> 00:01:56,870 There's not much more to the standard command line tools. 27 00:01:56,910 --> 00: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 28 00:02:03,900 --> 00:02:09,350 which being the same across operating systems we can simply copy from the engine X website. 29 00:02:09,480 --> 00:02:15,900 The page we are looking for is the engine X init scripts ressource page this time on engine X dot com 30 00:02:16,440 --> 00:02:19,560 again linked in the list and resources we have here. 31 00:02:19,560 --> 00:02:25,080 The old init scripts which as mentioned you can find a lesson on in the archive section of the Course 32 00:02:25,230 --> 00:02:26,060 she Jeff to use. 33 00:02:26,080 --> 00:02:34,800 That and a bit further down system de navigate to the example serve as file which is the script here 34 00:02:35,250 --> 00:02:37,350 and in the instructions we see the location. 35 00:02:37,350 --> 00:02:39,270 This file needs to exist in. 36 00:02:40,040 --> 00:02:41,680 I'll copy this location. 37 00:02:42,480 --> 00:02:47,610 Create that file in the given location and add the script contents. 38 00:02:47,840 --> 00:02:51,350 I am simply going to use the built in n.a. Editor for this. 39 00:02:51,510 --> 00:02:54,930 No no that new file which is empty of course. 40 00:02:54,930 --> 00:02:58,660 So copy the system D serve a script from that example by H. 41 00:03:00,310 --> 00:03:01,080 Haste. 42 00:03:01,510 --> 00:03:07,150 And now notice that a couple of these sittings will have to be changed to match our injured configuration 43 00:03:07,690 --> 00:03:10,040 starting with the p I define location. 44 00:03:10,060 --> 00:03:17,850 As we sit in the configuration step prior to building the engine X source slash var run engine Exon 45 00:03:17,870 --> 00:03:26,200 be idae and our engine X executable or esben path were simply user burn in generics. 46 00:03:26,410 --> 00:03:29,290 So change both occurrences of those. 47 00:03:29,290 --> 00:03:34,810 This first one being the pre start command for checking the engineer syntax and the second the actual 48 00:03:34,810 --> 00:03:36,430 start command. 49 00:03:36,430 --> 00:03:37,780 That's all we need to change. 50 00:03:37,810 --> 00:03:40,590 So save the file with control oh. 51 00:03:40,930 --> 00:03:45,100 Confirm and control x to exit the editor. 52 00:03:45,220 --> 00:03:47,910 That's all there is to configuring the servers for engine X.. 53 00:03:47,980 --> 00:03:51,180 So lets start engine X back up using System D. 54 00:03:51,220 --> 00:03:58,360 This time of khelil this run system C T L being the system D command. 55 00:03:58,600 --> 00:04:02,180 Start engine x no errors. 56 00:04:02,200 --> 00:04:04,270 So check the process exists. 57 00:04:05,190 --> 00:04:05,960 And there we have it. 58 00:04:05,970 --> 00:04:12,240 Engine X is up and running but with our system D service enabled we can now also check engine access 59 00:04:12,250 --> 00:04:21,120 status using System D instead of the process command again system C T L status in generics which gives 60 00:04:21,120 --> 00:04:27,210 us this really informative printout of the engine X server status system resources currently being used 61 00:04:27,210 --> 00:04:30,630 by engineers and the last few log messages. 62 00:04:30,630 --> 00:04:34,560 So already a much better way of managing the engineer service. 63 00:04:34,560 --> 00:04:38,100 Check back in the browser and the holding pages back. 64 00:04:38,100 --> 00:04:43,590 Stop it again this time with System C D L stop in generics. 65 00:04:46,200 --> 00:04:47,410 And Dell. 66 00:04:47,690 --> 00:04:52,800 Now as I mentioned the other very useful feature of a system D service is an ailing engine XT you start 67 00:04:52,860 --> 00:04:58,590 automatically when the system boots at the moment when this machine is shut down or reboot it. 68 00:04:58,600 --> 00:05:00,440 Engineers will no longer be running. 69 00:05:00,540 --> 00:05:03,530 Obviously not good for a web server in particular. 70 00:05:03,570 --> 00:05:05,820 So to an able start up on boot. 71 00:05:05,850 --> 00:05:10,520 We can run system C T L N able in Genex. 72 00:05:10,530 --> 00:05:12,560 This of course being a one self-command. 73 00:05:12,750 --> 00:05:17,750 So we get confirmation of a start up simulink being created for this service. 74 00:05:17,940 --> 00:05:21,530 We can test this by rebooting the machine reboot. 75 00:05:21,780 --> 00:05:24,750 I'll fast forward through this so we can connect back. 76 00:05:26,580 --> 00:05:33,270 Ubuntu machine is back up and running so check the engine status and we have confirmation engine X is 77 00:05:33,270 --> 00:05:39,380 running and should be listening on port 80 confirm in the browser and the holding page lote.