{"id":654,"date":"2019-02-12T14:17:25","date_gmt":"2019-02-12T11:17:25","guid":{"rendered":"https:\/\/artem.services\/?p=603"},"modified":"2019-02-19T01:42:57","modified_gmt":"2019-02-18T22:42:57","slug":"ubuntu-rc-local-2","status":"publish","type":"post","link":"https:\/\/artem.services\/?p=654&lang=en","title":{"rendered":"Ubuntu &#8212; rc.local"},"content":{"rendered":"<p>Faced with the fact that in <strong>Ubuntu<\/strong> there is no usual <strong>CentOS<\/strong> file with me &quot;<strong>rc.local<\/strong>&quot;, the solution is the following.<\/p>\n<p>Create a service:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nvim \/etc\/systemd\/system\/rc-local.service\r\n<\/pre>\n<p>with the following content:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n[Unit]\r\nDescription=\/etc\/rc.local Compatibility\r\nConditionPathExists=\/etc\/rc.local\r\n\r\n[Service]\r\nType=forking\r\nExecStart=\/etc\/rc.local start\r\nTimeoutSec=0\r\nStandardOutput=tty\r\nRemainAfterExit=yes\r\nSysVStartPriority=99\r\n\r\n[Install]\r\nWantedBy=multi-user.target\r\n<\/pre>\n<p>Create the file&quot;<strong>rc.local<\/strong>&quot; and add it to the execution bit:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\ntouch \/etc\/rc.local\r\nchmod +x \/etc\/rc.local\r\n<\/pre>\n<p><!--more--><\/p>\n<p>The contents of the file &quot;<strong>rc.local<\/strong>&quot;:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n#!\/bin\/sh -e\r\n#\r\n# rc.local\r\n#\r\n# This script is executed at the end of each multiuser runlevel.\r\n# Make sure that the script will &quot;exit 0&quot; on success or any other\r\n# value on error.\r\n#\r\n# In order to enable or disable this script just change the execution\r\n# bits.\r\n#\r\n# By default this script does nothing.\r\n\r\nexit 0\r\n<\/pre>\n<p>Add service to autorun:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsystemctl enable rc-local\r\n<\/pre>\n<p>run and check the status:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\nsystemctl start rc-local\r\nsystemctl status rc-local\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Faced with the fact that in Ubuntu there is no usual CentOS file with me &quot;rc.local&quot;, the solution is the following. Create a service: with the following content: Create the file&quot;rc.local&quot; and add it to the execution bit:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[341],"tags":[373,375],"_links":{"self":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/654"}],"collection":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=654"}],"version-history":[{"count":4,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/654\/revisions"}],"predecessor-version":[{"id":658,"href":"https:\/\/artem.services\/index.php?rest_route=\/wp\/v2\/posts\/654\/revisions\/658"}],"wp:attachment":[{"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/artem.services\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}