{"id":736,"date":"2021-01-10T00:00:37","date_gmt":"2021-01-10T00:00:37","guid":{"rendered":"https:\/\/dft.wiki\/?p=736"},"modified":"2021-02-07T16:36:49","modified_gmt":"2021-02-07T16:36:49","slug":"run-commands-on-boot-in-linux","status":"publish","type":"post","link":"https:\/\/dft.wiki\/?p=736","title":{"rendered":"Run Commands on Boot in Linux"},"content":{"rendered":"<p>To execute commands on the start-up of the Linux add the commands at the file \/etc\/rc.local<\/p>\n<pre>sudo nano \/etc\/rc.local<\/pre>\n<p>The default content of this file starts with the line:<\/p>\n<pre>#!\/bin\/sh<\/pre>\n<p>And ends with:<\/p>\n<pre>exit 0<\/pre>\n<p>Any commands you want to execute has to be in between these lines.<\/p>\n<p>If the file does not exist, create it, and make sure it belongs to the user <strong>root<\/strong> and the privileges are <strong>755<\/strong>:<\/p>\n<pre>sudo chown root: \/etc\/rc.local\r\nsudo chmod 755 \/etc\/rc.local<\/pre>\n<p>Certify the <strong>rc-local.service<\/strong> is running and is enabled to start at the boot:<\/p>\n<pre>sudo systemctl status rc-local.service\r\nsudo systemctl enable rc-local.service<\/pre>\n<p>This procedure is the same for pretty much any Debian-based Linux but if you are using another distribution different than Ubuntu 20.04 and Raspberry Pi OS double search for any particularity.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>To execute commands on the start-up of the Linux add the commands at the file [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,6],"tags":[],"class_list":["post-736","post","type-post","status-publish","format-standard","hentry","category-linux","category-raspberry-pi"],"_links":{"self":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/736","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=736"}],"version-history":[{"count":3,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/736\/revisions"}],"predecessor-version":[{"id":919,"href":"https:\/\/dft.wiki\/index.php?rest_route=\/wp\/v2\/posts\/736\/revisions\/919"}],"wp:attachment":[{"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=736"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=736"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dft.wiki\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=736"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}