{"id":8382,"date":"2021-07-15T11:12:20","date_gmt":"2021-07-15T11:12:20","guid":{"rendered":"https:\/\/linuxways.net\/?p=8382"},"modified":"2021-07-15T11:12:20","modified_gmt":"2021-07-15T11:12:20","slug":"how-to-start-stop-or-restart-services-in-centos-8","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/centos\/how-to-start-stop-or-restart-services-in-centos-8\/","title":{"rendered":"How to Start, Stop or Restart Services in CentOS 8"},"content":{"rendered":"<p>In the old CentOS distribution, you use the service command or directly run a service on your system using the \u201c\/etc\/init.d\/&lt;service-name&gt; start\u201d command. In modern distributions, you can easily start, stop or restart a service on your CentOS system using the systemctl command. The systemctl command is a very useful tool through which you can examine and control the service manager and systemd system. A collection of system management tools, libraries, and daemons gives us complete information about server-wide and systemd services utilization. If systemctl command successfully runs on your system, it will display any output on the terminal window.<\/p>\n<p>We will describe in this tutorial, how to start, stop and restart services on CentOS 8 system using the systemctl utility. Let us implement the useful systemctl commands on CentOS 8 system.<\/p>\n<h2><strong>Prerequisites<\/strong><\/h2>\n<p>Users need sudo privileges to start, stop and restart a service.<\/p>\n<h2><strong>Start service on CentOS using systemctl command<\/strong><\/h2>\n<p>To start a service on your system, use the following syntax:<\/p>\n<pre>$ sudo systemctl start {service-name}<\/pre>\n<p>For example, to start the httpd service on your system run the below-given command:<\/p>\n<pre>$ sudo systemctl start httpd<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"871\" height=\"30\" class=\"wp-image-8383\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-448.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-448.png 871w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-448-300x10.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-448-768x26.png 768w\" sizes=\"auto, (max-width: 871px) 100vw, 871px\" \/><\/p>\n<h2><strong>Check service status using systemctl command<\/strong><\/h2>\n<p>To check the service running status on your CentOS 8 system, follow the following command syntax:<\/p>\n<pre>$ sudo systemctl status {service-name}<\/pre>\n<pre>$ sudo systemctl status httpd<\/pre>\n<p>The above command will show the running or deactivate status on the terminal window. If the specified service is running on your system then, active (running) status should display on the screen as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1101\" height=\"601\" class=\"wp-image-8384\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-449.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-449.png 1101w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-449-300x164.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-449-1024x559.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-449-768x419.png 768w\" sizes=\"auto, (max-width: 1101px) 100vw, 1101px\" \/><\/p>\n<h2><strong>Stop service on CentOS using systemctl command<\/strong><\/h2>\n<p>Sometimes, we need to stop service on your system to start a new service. So, to stop or deactivate the running service on your system, use the following syntax:<\/p>\n<pre>$ sudo systemctl stop {service-name}<\/pre>\n<pre>$ sudo systemctl stop httpd<\/pre>\n<p>After executing the above command, the running service will stop on your system. Now, check the status. The service deactivate (dead) status will display on the terminal window as follows:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1102\" height=\"421\" class=\"wp-image-8385\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-450.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-450.png 1102w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-450-300x115.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-450-1024x391.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-450-768x293.png 768w\" sizes=\"auto, (max-width: 1102px) 100vw, 1102px\" \/><\/p>\n<h2><strong>Restart a service using systemctl on CentOS 8<\/strong><\/h2>\n<p>To restart a service on CentOS 8, use the below-mentioned syntax:<\/p>\n<pre>$ sudo systemctl restart {service-name}<\/pre>\n<p>For example, to restart the stopped httpd service, run the following command:<\/p>\n<pre>$ sudo systemctl restart httpd<\/pre>\n<h2><strong>Reload service using systemctl command\u00a0<\/strong><\/h2>\n<p>To reload all the configuration files forcefully on your system, type the following command to reload a service:<\/p>\n<pre>$ sudo systemctl reload {service-name}<\/pre>\n<p>To reload the httpd service on your CentOS system, run the below-given command:<\/p>\n<pre>$ sudo systemctl reload httpd<\/pre>\n<h2><strong>Enable and disable service using systemctl command<\/strong><\/h2>\n<p>Systemctl service also helps users to enable and disable a service. To enable the httpd service on your system use the below-given command:<\/p>\n<pre>$ sudo system enable httpd<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1102\" height=\"660\" class=\"wp-image-8386\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-451.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-451.png 1102w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-451-300x180.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-451-1024x613.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-451-768x460.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-451-501x300.png 501w\" sizes=\"auto, (max-width: 1102px) 100vw, 1102px\" \/><\/p>\n<p>If you want to disable the httpd service due to some port issues. Then, run the below-mentioned command to disable it:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1100\" height=\"612\" class=\"wp-image-8387\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-452.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-452.png 1100w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-452-300x167.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-452-1024x570.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/07\/word-image-452-768x427.png 768w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><\/p>\n<h2><strong>Conclusion<\/strong><\/h2>\n<p>We have shown in this article how to start, stop and restart the httpd service on CentOS 8 system with the help of the systemctl command. Using this utility, you can easily control any systemd and server-wide service on your system. Give us your suggestions or feedback about this article. Thanks!<\/p>\n<p>&nbsp;<\/p>","protected":false},"excerpt":{"rendered":"<p>In the old CentOS distribution, you use the service command or directly run a service on your system using the \u201c\/etc\/init.d\/&lt;service-name&gt; start\u201d command. In modern distributions, you can&hellip;<\/p>","protected":false},"author":1,"featured_media":8438,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[93,48],"class_list":["post-8382","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","tag-centos-8","tag-services"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/8382","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=8382"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/8382\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/8438"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=8382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=8382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=8382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}