{"id":18648,"date":"2014-12-09T06:47:11","date_gmt":"2014-12-08T22:47:11","guid":{"rendered":"https:\/\/2blog.ilc.edu.tw\/25793\/2014\/12\/09\/cubietruck-%e6%b8%ac%e8%a9%a6-fedora-20-rc-local\/"},"modified":"2014-12-09T06:47:11","modified_gmt":"2014-12-08T22:47:11","slug":"cubietruck-%e6%b8%ac%e8%a9%a6-fedora-20-rc-local","status":"publish","type":"post","link":"https:\/\/2blog.ilc.edu.tw\/25793\/2014\/12\/09\/cubietruck-%e6%b8%ac%e8%a9%a6-fedora-20-rc-local\/","title":{"rendered":"CubieTruck \u6e2c\u8a66 &#8211; Fedora 20 rc.local"},"content":{"rendered":"<p>etc\/rc.local\u00a0\u6216 \/etc\/rc.d\/rc.local \u662f Linux\u00a0\u4e2d\u4e00\u500b\u7cfb\u7d71\u958b\u6a5f\u5feb\u8981\u5b8c\u6210\u6642\uff0c\u6703\u57f7\u884c\u7684\u4e00\u500b\u6a94\u6848\uff0c\u6709\u9ede\u50cf\u662f DOS\u00a0\u4e2d\u7684 autoexec.bat\u3002Fedora 20\u00a0\u4e2d\u4f3c\u4e4e\u6c92\u6709\u9019\u4e00\u500b\u6a94\u6848\uff0c\u8981\u81ea\u5df1\u624b\u52d5\u52a0\u4e0a\u53bb\u3002<br \/># <span style=\"color: #ff0000;\">vim \/etc\/rc.d\/rc.local<\/span><br \/><span style=\"color: #0000ff;\">#!\/bin\/bash<\/span><br \/><span style=\"color: #0000ff;\"># \u6253\u958b\u9375\u76e4\u4e0a\u7684 Num Lock<\/span><br \/><span style=\"color: #0000ff;\">[ -x \/usr\/bin\/numlockx ] &amp;&amp; numlockx on<\/span><\/p>\n<p>\u66f4\u6539\u6a94\u6848\u6b0a\u9650<br \/># <span style=\"color: #ff0000;\">chmod 755 \/etc\/rc.d\/rc.local<\/span><\/p>\n<p>\u91cd\u65b0\u958b\u6a5f\u5f8c\uff0c\u767c\u73fe numlock\u00a0\u71c8\u6709\u4eae\uff0c\u4f46\u4e5f\u51fa\u73fe\u4e86\u4e00\u4e9b\u932f\u8aa4\u8a0a\u606f<br \/>[@more@]\u6aa2\u67e5 rc-local\u00a0\u670d\u52d9\u51fa\u73fe\u7684\u932f\u8aa4\u8a0a\u606f<br \/># <span style=\"color: #ff0000;\">systemctl status rc-local.service<\/span><br \/><span style=\"color: #0000ff;\">rc-local.service &#8211; \/etc\/rc.d\/rc.local Compatibility<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0 Loaded: loaded (\/usr\/lib\/systemd\/system\/rc-local.service; static)<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0 Active: failed (Result: exit-code) since \u4e00 2014-10-20 14:31:58 CST; 6min ago<\/span><\/p>\n<p><span style=\"color: #0000ff;\">10\u6708 20 14:31:58 localhost systemd[1]: Starting \/etc\/rc.d\/rc.local Compatibility&#8230;<\/span><br \/><span style=\"color: #0000ff;\">10\u6708 20 14:31:58 localhost systemd[1]: rc-local.service: control process exited, code=exited status=1<\/span><br \/><span style=\"color: #0000ff;\">10\u6708 20 14:31:58 localhost systemd[1]: Failed to start \/etc\/rc.d\/rc.local Compatibility.<\/span><br \/><span style=\"color: #0000ff;\">10\u6708 20 14:31:58 localhost systemd[1]: Unit rc-local.service entered failed state.<\/span><\/p>\n<p>\u555f\u52d5 rc-local\u00a0\u670d\u52d9\u6642\u51fa\u73fe\u7684\u932f\u8aa4\u8a0a\u606f\uff0c\u770b\u8d77\u4f86\u597d\u50cf <span style=\"color: #0000ff;\">\/usr\/lib\/systemd\/system\/rc-local.service<\/span>\u00a0\u7f3a\u5c11\u4e86 <span style=\"color: #0000ff;\">Install<\/span>\u00a0\u7684\u5340\u6bb5<br \/># <span style=\"color: #ff0000;\">systemctl enable rc-local<\/span><br \/><span style=\"color: #0000ff;\">The unit files have no [Install] section. They are not meant to be enabled<\/span><br \/><span style=\"color: #0000ff;\">using systemctl.<\/span><br \/><span style=\"color: #0000ff;\">Possible reasons for having this kind of units are:<\/span><br \/><span style=\"color: #0000ff;\">1) A unit may be statically enabled by being symlinked from another unit&#8217;s<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0 .wants\/ or .requires\/ directory.<\/span><br \/><span style=\"color: #0000ff;\">2) A unit&#8217;s purpose may be to act as a helper for some other unit which has<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0 a requirement dependency on it.<\/span><br \/><span style=\"color: #0000ff;\">3) A unit may be started when needed via activation (socket, path, timer,<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0 D-Bus, udev, scripted systemctl call, &#8230;).<\/span><\/p>\n<p>\u5728<span style=\"color: #0000ff;\"> \/usr\/lib\/systemd\/system\/rc-local.service<\/span> \u6700\u5f8c\u9762\u52a0\u5165\u4e0b\u9762\u5340\u6bb5<br \/><span style=\"color: #0000ff;\">[Install]<\/span><br \/><span style=\"color: #0000ff;\">WantedBy=multi-user.target<\/span><\/p>\n<p>#<span style=\"color: #ff0000;\"> sed -i &#8216;$a[Install]nWantedBy=multi-user.target&#8217; \/usr\/lib\/systemd\/system\/rc-local.service<\/span><br \/><span style=\"color: #0000ff;\">[Install]<\/span><br \/><span style=\"color: #0000ff;\">WantedBy=multi-user.target<\/span><\/p>\n<p>\u958b\u6a5f\u555f\u52d5 rc.local \u670d\u52d9<br \/># <span style=\"color: #ff0000;\">systemctl enable rc-local<\/span><br \/><span style=\"color: #0000ff;\">ln -s &#8216;\/usr\/lib\/systemd\/system\/rc-local.service&#8217; &#8216;\/etc\/systemd\/system\/multi-user.target.wants\/rc-local.service&#8217;<\/span><\/p>\n<p>\u6aa2<span style=\"color: #ff0000;\">\u67e5 rc-local \u670d\u52d9\u72c0\u614b<\/span><br \/><span style=\"color: #ff0000;\"># systemctl status rc-local.service<\/span><br \/><span style=\"color: #0000ff;\">rc-local.service &#8211; \/etc\/rc.d\/rc.local Compatibility<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0 Loaded: loaded (\/usr\/lib\/systemd\/system\/rc-local.service; enabled)<\/span><br \/><span style=\"color: #0000ff;\">\u00a0\u00a0 Active: active (exited) since \u4e00 2014-10-20 14:46:42 CST; 11s ago<\/span><br \/><span style=\"color: #0000ff;\">\u00a0 Process: 1961 ExecStart=\/etc\/rc.d\/rc.local start (code=exited, status=0\/SUCCESS)<\/span><\/p>\n<p><span style=\"color: #0000ff;\">10\u6708 20 14:46:42 localhost systemd[1]: Started \/etc\/rc.d\/rc.local Compatibility.<\/span><\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>etc\/rc.local\u00a0\u6216 \/etc\/rc.d\/rc.local \u662f Linux\u00a0\u4e2d\u4e00\u500b\u7cfb\u7d71\u958b\u6a5f\u5feb\u8981\u5b8c\u6210\u6642\uff0c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/2blog.ilc.edu.tw\/25793\/2014\/12\/09\/cubietruck-%e6%b8%ac%e8%a9%a6-fedora-20-rc-local\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008CubieTruck \u6e2c\u8a66 &#8211; Fedora 20 rc.local\u3009<\/span><\/a><\/p>\n","protected":false},"author":55,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[170,171],"tags":[],"class_list":["post-18648","post","type-post","status-publish","format-standard","hentry","category-c-85297","category-c-85503"],"meta_key":{"_pingme":["1"],"_encloseme":["1"],"lt_post_id":["525273"]},"_links":{"self":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/18648"}],"collection":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/comments?post=18648"}],"version-history":[{"count":0,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/18648\/revisions"}],"wp:attachment":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/media?parent=18648"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/categories?post=18648"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/tags?post=18648"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}