RHEL7 Systemctl Explained - RHCSA - Tech Arkit
so how that system in it can be shown on how the system unit can be specified so basically the systemctl command the syntax is over here so here systemctl is the command you have to specify and hear what is the action you would like to do Sudarshan vision sensor you want to do a status on I want to do a restart are you wanted to Airoli Lodha you want just wanted to see the related stuff on the service all this stuff and here you can specify that whatever the name the service name ok and its unique name so any so like this service name its unique name the unit name can be service that surveys are socket or device name or mount name and automount name of name target or path timer a slice a scope there are a number of units files are there in that which you wanted to start example is that you wanted to start only the service then service name that unit name is service start some sockets on that service the service socket name on that service name.net socket you have to be fine so the unit name can be a service socket device mount phone swap target Parth timer please find hope so these are the unit available on the systemctl service so whatever the name you would like to most of the situations we use a bad service most of the situation to use that service or date mornings something like that but these are the you can use to be on this systemctl unit names you can use anything what is your requirement upon so for Service Management task the target unit will be service unit which have unit files with a suffix the services that service or don't forget that device or whatever it is however foremost Service Management commands you can actually leave of the dark service suffix which means that so you can simply leave that service for most of the services you wanted to restart or check the status are you wanted to show them the details about that service which process is using all the related stuff you can do that so let let go ahead and see some examples over here this I would like to see that and status of network service this is the exact the state of output will be in the status of full of put it gives a detailed information that is the service is running successfully are not ok the service is whether it is enabled which means that while restarting your system whether it is enabled or not ok which process ID it is exactly using and which exactly the path of that service file where it is located the script to start that service and what is this listening on and all the details about that can be given on this service status which means that the systemctl status on this any service if you take example for the systemctl status I would like to see that sshd status so the sea for everything which means that which is the dominant is used and which exactly name the path the file path is going to be load over here and whether it is unable to start on the whenever you restart with that it is unable to start on the startup process or not if it is enabled which means that your service is unable to start on the startup reboot the machine ok so this is the demon names related dogs if you can if you want to find some related documentation about that ssh related you can use these commands to do a some documentation stuff over here and which PID currently which is using and which Shield processor CG groups OK then which actually the complete unit is make it into the groove so one service can be done in to the multiple group related information of here so it will give you the all the details like which is running and what is the status of it which port is used listening on Ok that it is accepting all the socket numbers are not all the details it will give you are there I like to say that the systemctl sure ok I can see that internet service over here so I can give you the all the related information about that what it's doing series so what is actually doing audit this configuration and all the stuff it can give you example say that ssh data service which may be serious so what are those all this information is going to be give you in detail information that which is enabled or which is not enabled on which is ok everything will b is going to be give you so if you would like to verify that you're single line that whether the service is active or inactive or whether it is enabled or not enabled you can simply type that systemctl is active and provide the service name say that ok the service is active start on startup you can say that is it enabled essay enabled so like that you can verify any other services if you would like to get the status over here like this so whether it is active maybe can get the different outputs like it is master is is the storm or not stop activated not activated ok those are the information will get on the active status information so if you like to enable any service to start on startup can simply use that systemctl enable and service name the unit name service just I would like to say that table yes it is enabled if you like to restart maybe so if you like to restart these services you can simply simply say that restart over here the service will be restarted but you will not get any output over here you have to verify the status so that it will give the detail information about that whether service is restarted properly or not when it is started so all the details origin reload example say that what the difference between the we start and the reloads for the reloading the since its effect these services changes whatever changes you have changed on that service will be affected but the existing PID will never change if you reload the service so similar way you can see that the PID is 2563 if I would like to reload the sun systemctl service reload over here say kondai dot if you go and verify the status again serious 2563 is the same Id before and now that's what happens when the restart and reload is the differentiation there sorry road in the sense what is the configuration changes without interrupting the service you can apply to the service but if you restart it get interrupted and its PID get Delete completely what are the services what are the existing PID will be killed off and it will be start the new PID for verify that what are the dependency taken simply see that systemctl list dependencies dependencies and provide the name which would like to verify your here you that what are the how many dependencies are there for that series dependencies are there over here so like this you can verify the dependencies and you can verify the system units as well list so these are all the units which is going to be activated are the active currently running all this information on here this many units are currently this is done so there are more than that actually see this there are device anytime there are some different units were here to this most of the in HR Services and you can also see some mounts and can also see some part ok maybe can also see some different series swap and targets rocket also I can see you were here Tera different Unit II simplicity that ok these are the status you can also see that what is mean by the lord and active and serve all this information you can see your here so I should like to see that I'm unit files example that list all the unit files which are currently running or not running in abled not enabled all the information can be shown over here you can see this RP if you can also be filtered further if you like to show only be enabled and disabled want something like that you can also be filtered over here ok maybe the filter can be applied for the baby can also use some great if would like to see only the enabled services over here I can see that this many services not enabled which is going to be very very easy to identify the surface status and you can do that but here in the systemctl you can also set a default target different organisations which would you like to boot example say that I would like to boot into the in multi user target are the the emergency mode or what are the more you would like to MOD examples SCL I are they are what are these thus you wanted to say it you can do that as well examples 8 systemctl get default examples that what is the default target currently have so this is the target currently I have issue like to set a different term target you can also use systemctl and set default say that multi user data get this I would like to set this multi user that target so that whenever I reboot the machine it's going to be a NaCl I mode would like to change this back again to the graphical user mode you can use that graphical so that you can get this so this is how we can change your set default so these are the target she have currently so you can set any in a number of any number of can get to vote your system into the target so suddenly I am using American video currently I am using this graph graphic card at target so that whenever my system is booted it's going to be a run into the graphical mode you can see this this is the graphical mode if a set into the multi user mode it's going to be a RC airplane mode ok so whatever you wanted to say to cancel it but most of the uses a selfie Mania are used to see that the graphical mode so that the basics users can also be happy that whenever you this is a jio instead of CL I so that's what I can say that up buddy fall into the graphical mode that would be a m and great her that would be a useful for you to setup so but here in systemctl they have the different concept called am asking what is mean by the masking the services masking the services in the sense whenever you say that you stop the service are you disable the service the other user can other user can able to enable the service and start the service but if you must the service enable are they cannot start the Service until unless they are not the service so it is over here exam for say that systemctl I just I would like to disable kondadi service over here so that's going to be disabled and I'm going to verify that I'm system is cronbach Kisi that the system is going to be the contact the is disabled so I would like to say that it's going to be start so I stop the service and then just going to see the systemctl status from that data service with says that which is inactive and died which is disabled mode so shall I can see that some of the schedule for the sum of the commands are still trying to stop its related services ok if you would like to mask the service now so now what you can do that if you would like to start the service just see this status over here so which is smart Jism ask if would like to start the service and try or hear what happens servcice fail to start Kondotty Unity smart whenever you marked it so nobody can start the service are unable to service your they cannot do anything until unless they unmask this unmask now you can start the service you can see that is status Kisi that it is running and active like that you can verify you can mark the service whenever you don't need the service or you don't wanted to stop Whenever the service system is restarted are you can tell the other administrators of the other users that do not start the Service until unless they have be continuous requirement and that service to start so this is you can do to the all the services which are not required or which you don't wanted to start the service so that makes a lot of resources savings savings of your hardware resources are its can also be save your system from the unauthorised access using the services are security compromisation all this so that will enable you to make more secure of your system so this is about the systemctl guys you can also use the system CPL command to power off your machine reboot your machine ok even you can do this all to your system so this is how you can do that examples that I would like to reboot this machine so can do that simply a system is going to be rebooted are you can also for of using this systemctl command something like that make use of systemctl so that will be perfect timed use this our future in future so all the best of you thanks for watching stay tune please subscribe the Tech Arkit channel for more upcoming videos and courses
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment