{"id":5212,"date":"2020-07-03T13:34:38","date_gmt":"2020-07-03T17:34:38","guid":{"rendered":"https:\/\/www.globo.tech\/learning-center\/?p=5212"},"modified":"2020-07-03T13:39:15","modified_gmt":"2020-07-03T17:39:15","slug":"understanding-linux-runlevels","status":"publish","type":"post","link":"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/","title":{"rendered":"Understanding Linux Runlevels"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full is-resized is-style-default\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/07\/understanding-linux-runlevels.jpg\" alt=\"Understanding Linux Runlevels.\" class=\"wp-image-5213\" width=\"1200\" height=\"628\" srcset=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/07\/understanding-linux-runlevels.jpg 1200w, https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/07\/understanding-linux-runlevels-573x300.jpg 573w, https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/07\/understanding-linux-runlevels-768x402.jpg 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/figure>\n\n\n\n<p>Understanding <a href=\"https:\/\/www.linux.com\/what-is-linux\/\" target=\"_blank\" rel=\"noreferrer noopener\">Linux <\/a>Runlevels. Runlevel is a different mode that the Linux system used for different functions. There are differences in the runlevels according to the operating system. Typically, there are seven runlevel numbers from 0 to 6. You can switch to the other runlevel as per your need either by the system or manually by an administrator. Each runlevel has its own function.<\/p>\n\n\n\n<p><strong>A brief explanation of each runlevel is shown below:<\/strong><\/p>\n\n\n\n<p><strong>0 :<\/strong> It is used to shutdown the system. Nothing run in this runlevel.<br><strong>1 :<\/strong> It is a single user mode which means only root has access to the system. It does not allow non-root users to login and does not configure a network interface. Generally, this runlevel is used for recovery mode.<br><strong>2 :<\/strong> It is a multi-user mode. This is very similar to level 1 but it allows other users to login.<br><strong>3 :<\/strong> it is a multi-user mode with networking. Most services are runs in this level. The graphical interface also runs at this level.<br><strong>4 :<\/strong> It is undefined that means you can create your own custom runlevel using it.<br><strong>5 :<\/strong> It is a multi-user mode with graphical user interface. This is the standard runlevel for most of the LINUX based systems. So Linux desktop and the home user will generally get into this mode by default.<br><strong>6 :<\/strong> It is used to reboot the system. When you switch to this level, the reboot process is initiated.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Switching to a Different Runlevel<\/h2>\n\n\n\n<p>Before starting, it is important for you to know what is your current runlevel?<\/p>\n\n\n\n<p>You can simply run the following command to find your current runlevel:<\/p>\n\n\n\n<p><code> runlevel<\/code><\/p>\n\n\n\n<p>You should see the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> N 5<\/pre>\n\n\n\n<p><br>As you can see, the first number is the previous runlevel your system was running, and the second number is the current runlevel of your <a rel=\"noreferrer noopener\" href=\"https:\/\/www.globo.tech\/dedicated-server-hosting\" target=\"_blank\">system<\/a>. N stands for none that means the system was not in any different runlevel previously. The \u201c5\u201d means our system is currently in runlevel 5.<\/p>\n\n\n\n<p>You can switch to the different runlevel manually using the the init command.<\/p>\n\n\n\n<p>For example, if you want to reboot your system, change the runlevel to the 6 using the following command:<\/p>\n\n\n\n<p><code> init 6<\/code><\/p>\n\n\n\n<p>The above command will restart your system immediately.<\/p>\n\n\n\n<p>Each runlevel has its own directory located inside \/etc. You can list them with the following command:<\/p>\n\n\n\n<p><code> ls \/etc\/ | grep ^rc<\/code><\/p>\n\n\n\n<p>The output should be as following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> rc0.d\n rc1.d\n rc2.d\n rc3.d\n rc4.d\n rc5.d\n rc6.d<\/pre>\n\n\n\n<p><br>You can also list which processes are run in any run level. For example, list all processes run in the runlevel 2 using the following command:<\/p>\n\n\n\n<p><code> ls \/etc\/rc2.d\/<\/code><\/p>\n\n\n\n<p>You should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> README S20anydesk S20speech-dispatcher S70pppd-dns S99rc.local\n S16openvpn S20kerneloops S20virtualbox S91apache2\n S19mysql S20nginx S50saned S99grub-common\n S19postgresql S20rsync S70dns-clean S99ondemand<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><br>Change the default Runlevel<\/h2>\n\n\n\n<p>There are many reasons you might need to change the default runlevel of your system.<\/p>\n\n\n\n<p>If you are a system administrator and want to boot system into command-line interface instead GUI interface.<\/p>\n\n\n\n<p>For <a href=\"https:\/\/help.ubuntu.com\/lts\/installation-guide\/s390x\/ch01s01.html\" target=\"_blank\" rel=\"noreferrer noopener\">Ubuntu<\/a>\/<a href=\"https:\/\/www.debian.org\/intro\/about\" target=\"_blank\" rel=\"noreferrer noopener\">Debian<\/a> operating system, you can change the default runlevel by editing the file \/etc\/init\/rc-sysinit.conf:<\/p>\n\n\n\n<p><code> nano \/etc\/init\/rc-sysinit.conf<\/code><\/p>\n\n\n\n<p>Change the following line with your desired runlevel:<\/p>\n\n\n\n<p><code> env DEFAULT_RUNLEVEL=2<\/code><\/p>\n\n\n\n<p>Save and close the file when you are finished. Then, restart your system to boot into new runlevel.<\/p>\n\n\n\n<p>For CentOS\/RHEL\/Fedora operating system, you can achieve this by editing the file \/etc\/inittab:<\/p>\n\n\n\n<p><code> nano \/etc\/inittab<\/code><\/p>\n\n\n\n<p>Change the following line with your desired runlevel:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> id:5:initdefault:<\/pre>\n\n\n\n<p><br>Save and close the file when you are finished. Then, restart your system to get into the new runlevel.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>In the above guide, you learned what is runlevel and how to work with different runlevel. I hope this will helps you to understand the runlevel.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>Understanding Linux Runlevels. Linux operating systems have different runlevels, with different functions and purposes, numbered from zero to six.<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":3,"featured_media":5213,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[124,193,192],"class_list":["post-5212","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog","tag-linux","tag-runlevel","tag-runlevels"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Understanding Linux Runlevels - Globo.Tech<\/title>\n<meta name=\"description\" content=\"Understanding Linux Runlevels. Linux operating systems have different runlevels, with different functions and purposes, numbered from zero to six.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Understanding Linux Runlevels - Globo.Tech\" \/>\n<meta property=\"og:description\" content=\"Understanding Linux Runlevels. Linux operating systems have different runlevels, with different functions and purposes, numbered from zero to six.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/\" \/>\n<meta property=\"og:site_name\" content=\"Globo.Tech\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-03T17:34:38+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-07-03T17:39:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/07\/understanding-linux-runlevels.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"GloboTech Communications\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"GloboTech Communications\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/\",\"name\":\"Understanding Linux Runlevels - Globo.Tech\",\"isPartOf\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/07\/understanding-linux-runlevels.jpg\",\"datePublished\":\"2020-07-03T17:34:38+00:00\",\"dateModified\":\"2020-07-03T17:39:15+00:00\",\"author\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\"},\"description\":\"Understanding Linux Runlevels. Linux operating systems have different runlevels, with different functions and purposes, numbered from zero to six.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/#primaryimage\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/07\/understanding-linux-runlevels.jpg\",\"contentUrl\":\"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/07\/understanding-linux-runlevels.jpg\",\"width\":1200,\"height\":628,\"caption\":\"Understanding Linux Runlevels\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.globo.tech\/learning-center\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Understanding Linux Runlevels\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#website\",\"url\":\"https:\/\/www.globo.tech\/learning-center\/\",\"name\":\"Globo.Tech\",\"description\":\"Welcome to the Official Globo.Tech Learning Center\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87\",\"name\":\"GloboTech Communications\",\"sameAs\":[\"http:\/\/www.gtcomm.net\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Understanding Linux Runlevels - Globo.Tech","description":"Understanding Linux Runlevels. Linux operating systems have different runlevels, with different functions and purposes, numbered from zero to six.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/","og_locale":"en_US","og_type":"article","og_title":"Understanding Linux Runlevels - Globo.Tech","og_description":"Understanding Linux Runlevels. Linux operating systems have different runlevels, with different functions and purposes, numbered from zero to six.","og_url":"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/","og_site_name":"Globo.Tech","article_published_time":"2020-07-03T17:34:38+00:00","article_modified_time":"2020-07-03T17:39:15+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/07\/understanding-linux-runlevels.jpg","type":"image\/jpeg"}],"author":"GloboTech Communications","twitter_misc":{"Written by":"GloboTech Communications","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/","url":"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/","name":"Understanding Linux Runlevels - Globo.Tech","isPartOf":{"@id":"https:\/\/www.globo.tech\/learning-center\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/#primaryimage"},"image":{"@id":"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/#primaryimage"},"thumbnailUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/07\/understanding-linux-runlevels.jpg","datePublished":"2020-07-03T17:34:38+00:00","dateModified":"2020-07-03T17:39:15+00:00","author":{"@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87"},"description":"Understanding Linux Runlevels. Linux operating systems have different runlevels, with different functions and purposes, numbered from zero to six.","breadcrumb":{"@id":"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/#primaryimage","url":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/07\/understanding-linux-runlevels.jpg","contentUrl":"https:\/\/www.globo.tech\/learning-center\/wp-content\/uploads\/2020\/07\/understanding-linux-runlevels.jpg","width":1200,"height":628,"caption":"Understanding Linux Runlevels"},{"@type":"BreadcrumbList","@id":"https:\/\/www.globo.tech\/learning-center\/understanding-linux-runlevels\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.globo.tech\/learning-center\/"},{"@type":"ListItem","position":2,"name":"Understanding Linux Runlevels"}]},{"@type":"WebSite","@id":"https:\/\/www.globo.tech\/learning-center\/#website","url":"https:\/\/www.globo.tech\/learning-center\/","name":"Globo.Tech","description":"Welcome to the Official Globo.Tech Learning Center","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.globo.tech\/learning-center\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.globo.tech\/learning-center\/#\/schema\/person\/e17784b37f4a4f49b7bc611847912e87","name":"GloboTech Communications","sameAs":["http:\/\/www.gtcomm.net"]}]}},"_links":{"self":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/5212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/comments?post=5212"}],"version-history":[{"count":8,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/5212\/revisions"}],"predecessor-version":[{"id":5222,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/posts\/5212\/revisions\/5222"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media\/5213"}],"wp:attachment":[{"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/media?parent=5212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/categories?post=5212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.globo.tech\/learning-center\/wp-json\/wp\/v2\/tags?post=5212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}