{"id":2250,"date":"2022-10-06T19:47:44","date_gmt":"2022-10-06T17:47:44","guid":{"rendered":"https:\/\/nguenkam.com\/blog\/?p=2250"},"modified":"2022-10-12T01:00:43","modified_gmt":"2022-10-11T23:00:43","slug":"fixes-system-has-not-been-booted-with-systemd-as-init-system","status":"publish","type":"post","link":"https:\/\/nguenkam.com\/blog\/index.php\/2022\/10\/06\/fixes-system-has-not-been-booted-with-systemd-as-init-system\/","title":{"rendered":"[ Fixes] System Has Not Been Booted With Systemd as Init System"},"content":{"rendered":"\n<p>When you run Systemd commands, you may receive error &#8220;<strong>System has not been booted with systemd as init system (PID 1). Can&#8217;t operate.<\/strong><\/p>\n\n\n\n<p>The reason why this error occurs is that the Linux system is not using systemd as the init system : <em>you are trying to&nbsp;<a href=\"https:\/\/linuxhandbook.com\/systemd-list-services\/\">use systemd command to manage services<\/a>&nbsp;on Linux but your system doesn&#8217;t use&nbsp;<a href=\"https:\/\/wiki.archlinux.org\/index.php\/Systemd\">systemd<\/a>&nbsp;and (most likely) using the classic&nbsp;<a href=\"https:\/\/wiki.archlinux.org\/index.php\/Sysvinit\">SysV init<\/a>&nbsp;(sysvinit) system.<\/em><\/p>\n\n\n\n<p>But how is that possible?&nbsp;If you are using Ubuntu inside Windows using WSL, you will have <strong>SysV<\/strong> instead of <strong>systemd<\/strong> and your system will complain when you run the systemctl command <em>(intended for Linux systems with systemd init system).<\/em><\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5>How to know which &#8220;Init System&#8221; you are using ?<\/h5>\n\n\n\n<p>You may use this command to know the process name associated with PID 1 (the first process that runs on your system):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ps -p 1 -o comm=<\/code><\/pre>\n\n\n\n<p>It should show init or sysv (or something like that) in the output. If you see init, your system is not using systemd and you should use the init commands as explained in the next section.<\/p>\n\n\n\n<div style=\"height:100px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h5>How to fix &#8216;System has not been booted with systemd&#8217; error?<\/h5>\n\n\n\n<p>The simple answer is to not use the systemctl command. Instead, use the equivalent sysvinit command.<\/p>\n\n\n\n<p>It&#8217;s not too complicated and both commands have somewhat similar syntax.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" src=\"https:\/\/nguenkam.com\/blog\/wp-content\/uploads\/2022\/10\/systemd-sysv.png\" alt=\"\" class=\"wp-image-2251\" width=\"484\" height=\"277\" srcset=\"https:\/\/nguenkam.com\/blog\/wp-content\/uploads\/2022\/10\/systemd-sysv.png 792w, https:\/\/nguenkam.com\/blog\/wp-content\/uploads\/2022\/10\/systemd-sysv-300x172.png 300w, https:\/\/nguenkam.com\/blog\/wp-content\/uploads\/2022\/10\/systemd-sysv-768x439.png 768w\" sizes=\"(max-width: 484px) 100vw, 484px\" \/><\/figure><\/div>\n\n\n\n<h5><\/h5>\n","protected":false},"excerpt":{"rendered":"<p>When you run Systemd commands, you may receive error &#8220;System has not been booted with systemd as init system (PID 1). Can&#8217;t operate. The reason why this error occurs is that the Linux system is not using systemd as the init system : you are trying to&nbsp;use systemd command to manage services&nbsp;on Linux but your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2276,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[172,171,193,608,605,225,227,606,607,161,217,580],"_links":{"self":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2250"}],"collection":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=2250"}],"version-history":[{"count":4,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2250\/revisions"}],"predecessor-version":[{"id":2256,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2250\/revisions\/2256"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media\/2276"}],"wp:attachment":[{"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=2250"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=2250"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nguenkam.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=2250"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}