{"id":54,"date":"2022-04-30T09:42:07","date_gmt":"2022-04-30T01:42:07","guid":{"rendered":"https:\/\/www.weiqs.cn\/blog\/?p=54"},"modified":"2022-04-30T09:48:12","modified_gmt":"2022-04-30T01:48:12","slug":"ubuntu-4","status":"publish","type":"post","link":"https:\/\/www.weiqs.cn\/blog\/index.php\/2022\/04\/30\/ubuntu-4\/","title":{"rendered":"Ubuntu 18.04\u5f00\u673a\u81ea\u542f"},"content":{"rendered":"\n<p>Ubuntu 18.04\u9ed8\u8ba4\u8fdb\u7a0b\u542f\u52a8\u7ba1\u7406\u5df2\u7ecf\u5207\u6362\u81f3systemd\uff0c\u4e0d\u5728\u4f7f\u7528SysV\u3002\u5982\u679c\u60f3\u50cf\u4e4b\u524d\u4e00\u6837\u4f7f\u7528\/etc\/rc.local\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8\uff0c\u8bf7\u5982\u4e0b\u8bbe\u7f6e<\/p>\n\n\n\n<p><strong>1.\u4fee\u6539rc-local.service<\/strong><br>\/lib\/systemd\/system\/rc-local.service\u65b0\u589e\uff1a<\/p>\n\n\n\n<p>[Install]<br>WantedBy=multi-user.target<br>Alias=rc-local.service<\/p>\n\n\n\n<p><strong>2.\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8rc-local<\/strong><br>systemctl enable rc-local<\/p>\n\n\n\n<p><strong>3.\u521b\u5efa\/etc\/rc.local \u6216 sudo cp rc.local  \/etc\/<\/strong><\/p>\n\n\n\n<p>#!\/bin\/bash <\/p>\n\n\n\n<p>echo &#8220;test rc.local &#8221; &gt; \/tmp\/rctest.log<\/p>\n\n\n\n<p>#\u6dfb\u52a0\u4f60\u9700\u8981\u81ea\u542f\u7684<\/p>\n\n\n\n<p>EOF<\/p>\n\n\n\n<p><strong>4.\u65b0\u589e\u6267\u884c\u6743\u9650<\/strong><br>sudo chmod +x \/etc\/rc.local<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu 18.04\u9ed8\u8ba4\u8fdb\u7a0b\u542f\u52a8\u7ba1\u7406\u5df2\u7ecf\u5207\u6362\u81f3systemd\uff0c\u4e0d\u5728\u4f7f\u7528SysV\u3002\u5982\u679c\u60f3\u50cf\u4e4b\u524d\u4e00\u6837\u4f7f\u7528\/et [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[7],"class_list":["post-54","post","type-post","status-publish","format-standard","hentry","category-technology-share","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":2,"href":"https:\/\/www.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/54\/revisions"}],"predecessor-version":[{"id":58,"href":"https:\/\/www.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/54\/revisions\/58"}],"wp:attachment":[{"href":"https:\/\/www.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=54"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=54"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.weiqs.cn\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}