{"id":2392,"date":"2018-02-23T15:13:11","date_gmt":"2018-02-23T07:13:11","guid":{"rendered":"http:\/\/learn-house.idv.tw\/?p=2392"},"modified":"2018-02-23T15:14:50","modified_gmt":"2018-02-23T07:14:50","slug":"%e8%bd%89android%e7%b3%bb%e7%b5%b1%e5%95%9f%e5%8b%95%e6%b5%81%e7%a8%8b%e4%b9%8binit-rc%e8%a9%b3%e7%b4%b0%e5%88%86%e6%9e%90%e7%ad%86%e8%a8%98","status":"publish","type":"post","link":"https:\/\/learn-house.idv.tw\/?p=2392","title":{"rendered":"[\u8f49]android\u7cfb\u7d71\u555f\u52d5\u6d41\u7a0b\u4e4binit.rc\u8a73\u7d30\u5206\u6790\u7b46\u8a18"},"content":{"rendered":"<p>\u4f86\u6e90\uff1ahttps:\/\/www.2cto.com\/kf\/201312\/262252.html<br \/>\n\u5c0d\u65bcandroid\u7cfb\u7d71\u7684\u5b78\u7fd2\u638c\u63e1\uff0c\u9664\u4e86\u5c0d\u4e00\u4e9b\u8a9e\u8a00\u57fa\u790e\u7684\u8981\u6c42\uff0c\u5982C\uff0cC++\uff0cjava\uff0cshell\uff0cmakefile\u7b49\uff0c\u66f4\u8981\u6574\u9ad4\u53bb\u628a\u63e1\u7cfb\u7d71\u7684\u67b6\u69cb\u3002\u5c0d\u65bc\u67b6\u69cb\u7684\u719f\u6089\u5165\u9580\uff0c\u9996\u5148\u61c9\u8a72\u5206\u6790android\u7684\u7de8\u8b6f\u7cfb\u7d71\u7d50\u69cb\u3002\u800c\u5c0d\u65bc\u7cfb\u7d71\u7684\u555f\u52d5\u6d41\u7a0b\u7684\u638c\u63e1\uff0c\u6700\u597d\u662f\u6df1\u5165\u5206\u6790init.rc\u3001init.xx.rc\u7b49\u6587\u4ef6\u3002\u9019\u4e9b\u6587\u4ef6\u76f8\u5c0d\u4f86\u8aaa\u4ee3\u78bc\u91cf\u5c11\uff0c\u6bd4\u8f03\u7c21\u55ae\uff0c\u800c\u4e14\u5c0d\u7cfb\u7d71\u7684\u6574\u9ad4\u8a8d\u8b58\u6709\u5f88\u5927\u7684\u5e6b\u52a9\u3002\u4ee5\u524d\u5728\u5de5\u4f5c\u4e2d\u7d93\u5e38\u8981\u7528\u5230init.rc\u76f8\u95dc\u7684\u77e5\u8b58\uff0c\u4f46\u662f\u6c92\u6709\u7cfb\u7d71\u7684\u53bb\u5206\u6790\u6574\u9ad4\uff0c\u6700\u8fd1\u5beb\u6210\u4e86\u7b46\u8a18\uff0c\u5206\u4eab\u51fa\u4f86\uff01<br \/>\n<!--more--><\/p>\n<p>\u95dc\u65bcinit.rc\u7684\u5e7e\u9ede\u8aaa\u660e\uff1a<br \/>\n1).\u5728android\u6e90\u78bc\u76ee\u9304\u4e0b\u9762jb\\system\\core\\init\\readme.txt\u6587\u4ef6\u4e2d\u6709init.rc\u8a9e\u6cd5\u7684\u8a73\u7d30\u5b9a\u7fa9<br \/>\n\u6ce8\u610f\uff1areadme.txt\u6c92\u6709\u548candroid\u7684\u7248\u672c\u4e00\u8d77\u66f4\u65b0\uff0c\u6240\u4ee5\u5728\u65b0\u7248\u672c\u7684android\u4e2d\uff0c\u589e\u52a0\u4e86\u4e00\u4e9bcommands\u3001options\u7b49\uff0c\u5728readme.txt\u4e2d \u6c92\u6709\u4ecb\u7d39\u3002 \u9084\u662f\u770binit\u76ee\u9304\u4e0b\u9762\u7684\u6e90\u78bc\u6700\u70ba\u6e96\u78ba<\/p>\n<p>2).\u89e3\u6790init.rc\uff0cinit.xx.rc\u7684\u76f8\u95dc\u6587\u4ef6\u76ee\u9304system\/core\/init\/<\/p>\n<p>3).init.c \u3001init.rc init.xx.rc \u7b49\u6700\u7d42\u6703\u7de8\u8b6f\u5230ramdisk.img(\u6839\u6587\u4ef6\u7cfb\u7d71)\u4e2d\uff0c\u548ckernel\u4e00\u8d77\u6253\u5305\u6210boot.img\u3002android\u555f\u52d5\u5f8c\u6bcf\u6b21\u90fd\u6703\u5f9eboot.img\u4e2d\u89e3\u58d3\u51fainit.c\u7b49\u6587\u4ef6\u5230\u5167\u5b58\uff0c\u6240\u4ee5\u8981\u4fee\u6539\u5fc5\u9808\u4fee\u6539\u66ff\u63dbboot.img\u3002<\/p>\n<p>4).\u5728init.rc\u4e2d\u555f\u52d5\u7684\u670d\u52d9\uff0c\u90fd\u662f\u4ee5\u4e00\u500b\u9032\u7a0b\u7684\u5f62\u5f0f\u904b\u884c\uff0c\u5c6c\u65bcandroid\u7684\u672c\u5730\u670d\u52d9\u3002\u901a\u904e\u5728\u7d42\u7aef\u8f38\u5165PS\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u5728\u904b\u884c\u7684\u76f8\u61c9\u9032\u7a0b\uff0c\u4ed6\u5011\u7684ppid\u90fd\u70ba1\uff0c\u4ee3\u8868init\u9032\u7a0b\u3002 init\u9032\u7a0b\u4e5f\u662fandroid\u7cfb\u7d71\u555f\u52d5\u7684\u7b2c\u4e00\u500b\u61c9\u7528\u9032\u7a0b<\/p>\n<p>5).init.rc\u4e2d\u6240\u6709\u7684\u8a9e\u53e5\u90fd\u662f\u4ee5\u884c\u70ba\u55ae\u4f4d\u7684\uff08\u6bcf\u500b\u8a9e\u53e5\u90fd\u662f\u55ae\u7368\u5beb\u5728\u4e00\u884c\u88e1\u9762\uff09<\/p>\n<p>6).\u8a3b\u91cb\u884c\u4ee5\u300c#\u300d\u958b\u982d<\/p>\n<p>7).Actions \u548c Services\u8868\u793a\u4e00\u500b\u65b0\u7684\u6bb5\u843dsection\u7684\u958b\u59cb\u3002<br \/>\n\u6240\u6709\u7684commands\u548coptions \u90fd\u662f\u6b78\u5c6c\u65bc\u4e0a\u65b9\u6700\u8fd1\u7684\u4e00\u500b\u6bb5\u843d\u3002\u5728\u7b2c\u4e00\u500b\u6bb5\u843d\u4e4b\u524d\u7684commands\u548coptions\u662f\u7121\u6548\u7684\u3002<\/p>\n<p>8).Actions and Services<br \/>\n\u4e0d\u80fd\u91cd\u540d\uff0c\u5982\u679c\u91cd\u540d\uff0c\u5f8c\u9762\u7684\u5b9a\u7fa9\u6703\u88ab\u5ffd\u7565\uff08readme.txt\u8aaa\u660e\uff09\u3002<br \/>\n\u4f46\u662f\u5be6\u969b\u9805\u76ee\u4e2d\u540c\u4e00\u500binit.xx.rc\u4e2d\u6709\u91cd\u540d\u7684action\uff0c\u4e5f\u53ef\u4ee5\u6b63\u5e38\u4f7f\u7528\u3002\u591a\u500binit.xx.rc\u4e2daction\u4e5f\u5141\u8a31\u6709\u91cd\u540d\uff0c \u6bd4\u5982 boot\uff0cinit \u7b49\u5728\u591a\u500brc\u6587\u4ef6\u4e2d\u51fa\u73fe\u3002services\u61c9\u8a72\u4e0d\u80fd\u91cd\u540d<\/p>\n<p>init.rc \uff08Android Init Language\uff09\u8a9e\u6cd5\u8a73\u89e3\uff1a<\/p>\n<p>1.init\u8a9e\u6cd5\u7684\u56db\u500b\u7d44\u6210\u539f\u4ef6\uff1a<br \/>\nActions \uff1a\u52d5\u4f5c \uff0c\u4f7f\u7528\u683c\u5f0f\uff1a on ,\u4e0b\u9762\u884c\u8ddf\u5404\u7a2ecommand<br \/>\nCommands \uff1a\u547d\u4ee4<br \/>\nServices \uff1a\u670d\u52d9 \u4f7f\u7528\u683c\u5f0f \uff1a service [ ]* \uff0c\u4e0b\u9762\u884c\u53ef\u4ee5\u6dfb\u52a0Options<br \/>\nOptions \uff1a \u9078\u9805<\/p>\n<p>2.init.rc\u4e2d\u4e09\u5927\u6a21\u584a\uff1a<br \/>\n1\uff09. import \u5c0e\u5165\u5176\u4ed6\u7684init.xx.rc\u6587\u4ef6\u3002<br \/>\n2\uff09. \u4ee5action\u52d5\u4f5c\u70ba\u89f8\u767c\u9ede\u7684\u4e00\u7cfb\u5217\u547d\u4ee4<br \/>\n3\uff09. \u5e36\u6709\u5404\u7a2eOptions\u7684\u4e00\u7cfb\u5217services\u7684\u5b9a\u7fa9<\/p>\n<p>import \/init.${ro.hardware}.rc<br \/>\n\u901a\u904ecat proc\/cpuinfo\u53ef\u4ee5\u67e5\u770bro.hardware\u7684\u503c=Hardware\u7684\u503c<\/p>\n<p>on \/\/action \u6a21\u578b<\/p>\n<p>&#8230;.<\/p>\n<p>service [ ]* \uff08services\u53ef\u4ee5\u5e36\u6709\u591a\u500b\u53c3\u6578\u548c\u9078\u9805\uff09<br \/>\n&#8230;<\/p>\n<p>3.\u5c0dActions\u5b98\u65b9\u63cf\u8ff0\u7684\u4e00\u4e9b\u7406\u89e3 \uff1a<br \/>\n\u7576action\u7684trigger\u88ab\u5339\u914d\u5f8c\uff0caction\u6703\u88ab\u52a0\u5165\u5230\u52d5\u4f5c\u57f7\u884c\u968a\u5217\u4e2d\uff0c\u5728\u968a\u5217\u4e2d\u7684action\u6309\u968a\u5217\u9806\u5e8f\u88ab\u57f7\u884c\uff0c\u6bcf\u500baction\u4e0b\u9762\u7684command\u4e5f\u662f\u6309\u9806\u5e8f\u57f7\u884c\u3002\u6309\u9019\u500b\u7406\u8ad6\uff0c\u5728init.rc\u4e2daction\u3001command\u3001service\u7684\u57f7\u884c\u9806\u5e8f\u4e3b\u8981\u662f\u548c\u5b83\u5011\u7684\u89f8\u767c\u6642\u9593\u6709\u95dc\uff0c\u5982\u679c\u90fd\u662f\u958b\u6a5f\u555f\u52d5\u6642\u57f7\u884c\uff0c\u61c9\u8a72\u4e5f\u548c\u4ee3\u78bc\u9806\u5e8f\u6709\u95dc\u3002\uff08\u6709\u8208\u8da3\u53ef\u4ee5\u9a57\u8b49\u4e00\u4e0b\u3001\u60f3\u6df1\u5165\u77ad\u89e3\u89e3\u6790\u904e\u7a0b\uff0c\u53ef\u4ee5\u67e5\u770b\u6e90\u78bc\u76ee\u9304init\u4e0b\u9762\u7684init_parser.c\u7b49\u6587\u4ef6\uff09<\/p>\n<p>4.Triggers \uff1a \u8ddf\u5728on\u5f8c\u9762\u7684\u52d5\u4f5c\u540d\uff0c\u7528\u4f86\u89f8\u767caction\u4e0b\u9762command\u7684\u57f7\u884c<\/p>\n<p>1\uff09.android\u5e38\u7528\u7684triggers\u7684\u540d\u5b57\uff1a<br \/>\nearly-init\uff0cinit\uff0cearly-fs\uff0cfs\uff0cpost-fs\uff0cearly-boot\uff0cboot \uff08\u9019\u4e9b\u90fd\u662f\u5728init.c\u4e2d\u89f8\u767c\uff09<\/p>\n<p>2).\u53ef\u4ee5\u81ea\u5b9a\u7fa9\u4e00\u4e9btriggers\uff0c\u4e26\u9078\u64c7\u5408\u9069\u7684\u89f8\u767c\u65b9\u5f0f \uff08\u4f8b\u5982\uff1a\u95dc\u6a5f\u5145\u96fb\u529f\u80fd\uff0c\u53ef\u4ee5\u53ea\u555f\u52d5charger\u670d\u52d9\u9032\u7a0b\uff09<\/p>\n<p>3).= \u5f62\u5f0f\uff0c\u5982\uff1aon property:ro.debuggable=1<\/p>\n<p>4). device-added-<br \/>\ndevice-removed-<br \/>\nTriggers of these forms occur when a device node is added or removed<br \/>\n\u4e00\u500b\u8a2d\u5099\u7bc0\u9ede\/dev\/XXX\u6dfb\u52a0\u6216\u8005\u522a\u9664\u6642\u53ef\u4ee5\u89f8\u767c\u4e00\u500baction\uff0c\u9019\u500b\u53ef\u4ee5\u5f88\u597d\u7684\u53bb\u5229\u7528<\/p>\n<p>5).service-exited-<br \/>\nTriggers of this form occur when the specified service exits.<br \/>\n\u7576\u67d0\u500b\u670d\u52d9\u9000\u51fa\u6642\uff0c\u53ef\u4ee5\u89f8\u767c\u4e00\u500baction<\/p>\n<p>5.option \u9078\u9805\uff1a(\u7528\u65bcservices\u4e0b\u9762)<br \/>\nandroid\u65b0\u7248\u672c\u4e0a\u589e\u52a0\u7684\u4e00\u4e9boptions\u53ef\u4ee5\u901a\u904e\u6e90\u78bc\u67e5\u770b\u5c0d\u61c9\u4f5c\u7528<br \/>\ninit_parser.c&#8211;\u300blookup_keyword(const char *s)&#8211;\u300bparse_line_service\uff08\uff09 \u6216\u8005 &#8211;\u300bparse_line_action\uff08\uff09<\/p>\n<p>1).class<br \/>\n\u8aaa\u660e\u670d\u52d9\u5c6c\u65bcclass_name\u9019\u500b\u985e\u3002\u7f3a\u7701\u503cservice\u5c6c\u65bc \u300cdefault\u300d \u985e\u3002\u540c\u4e00\u500bclass\u4e0b\u9762\u7684\u670d\u52d9\u53ef\u4ee5\u4e00\u8d77\u555f\u52d5\u6216\u505c\u6b62\u3002<\/p>\n<p>2).disabled<br \/>\n\u8868\u793a\u7576\u9019\u500b\u670d\u52d9\u6240\u5728\u7684class\u555f\u52d5\u7684\u6642\u5019\uff0c\u670d\u52d9\u4e0d\u6703\u81ea\u52d5\u555f\u52d5\uff0c<br \/>\n\u8981\u7528start server_name \u6216 property_set(&#8220;ctl.start&#8221;, server_name);\u624d\u80fd\u555f\u52d5\u3002<\/p>\n<p>3).oneshot<br \/>\n\u7576\u670d\u52d9\u9000\u51fa\u5f8c\uff0c\u4e0d\u6703\u518d\u91cd\u65b0\u555f\u52d5\uff0c\u5982\u679c\u6c92\u6709\u52a0\u9019\u500boption\uff0c\u5247\u670d\u52d9\u9ed8\u8a8d\u9000\u51fa\u5f8c\u53c8\u6703\u91cd\u65b0\u91cd\u555f<\/p>\n<p>4).user<br \/>\n\u57f7\u884c\u670d\u52d9\u4e4b\u524d\uff0c\u5148\u8072\u660e\u670d\u52d9\u7684\u7528\u6236\u540d\uff0c\u7f3a\u7701\u503c\u61c9\u8a72\u70baroot\u7528\u6236.<br \/>\n\u5982\u679c\u4f60\u7684\u9032\u7a0b\u8981\u6c42\u5177\u6709linux\u5167\u6838\u80fd\u529b\uff0c\u5fc5\u9808\u4fdd\u8b49\u5b83\u7684\u7528\u6236\u70baroot\uff08\u6c92\u6709\u5b8c\u5168\u660e\u767d\uff0c\u5be6\u4f8b\uff1f\uff09<\/p>\n<p>5).group [ ]*<br \/>\n\u57f7\u884c\u670d\u52d9\u4e4b\u524d\uff0c\u5148\u8072\u660e\u670d\u52d9\u6240\u5c6c\u7d44\u540d\uff0c\u53ef\u4ee5\u4e00\u6b21\u8072\u660e\u5c6c\u65bc\u591a\u500b\u7d44\u3002<br \/>\n\u8072\u660e\u591a\u500b\u7d44\u6642\uff0c\u9664\u7b2c\u4e00\u500b\u7d44\u540d\u5916\uff0c\u5176\u4ed6\u7684\u70ba\u670d\u52d9\u7684\u88dc\u5145\u7d44\u540d(\u8abf\u7528\u63a5\u53e3 setgroups()).<\/p>\n<p>6).onrestart + command<br \/>\n\u670d\u52d9\u91cd\u555f\u7684\u6642\uff0c\u6703\u57f7\u884conrestart\u5f8c\u9762\u7684command.<br \/>\neg\uff1aonrestart restart media \u91cd\u555f\u540d\u70bamedia\u7684\u670d\u52d9<\/p>\n<p>7).setenv<br \/>\n\u5728\u7576\u524d\u670d\u52d9\u9032\u7a0b\u4e2d\u8a2d\u7f6e\u74b0\u5883\u8b8a\u91cfname\u7684\u503c\u70bavalue\u3002<br \/>\n\u6ce8\u610f\uff1asetenv\u5b9a\u7fa9\u7684\u74b0\u5883\u8b8a\u91cf\u50c5\u5728\u672c\u9032\u7a0b\u5167\u751f\u6548\uff0c\u9000\u51fa\u8a72\u9032\u7a0b\uff0c\u6216\u8005\u95dc\u9589\u76f8\u61c9\u7684\u7a0b\u5e8f\u904b\u884c\u7a97\u53e3\uff0c\u8a72\u74b0\u5883\u8b8a\u91cf\u5373\u7121\u6548\uff09<br \/>\n\u7a0b\u5e8f\u4e2d\u53ef\u901a\u904egetenv(&#8220;name&#8221;)\u63a5\u53e3\u7372\u53d6\u9019\u500b\u74b0\u5883\u8b8a\u91cf\u7684\u503c<br \/>\nsetenv\u548cexport \u7684\u5340\u5225\uff1a<br \/>\nsetenv csh \uff0c\u672c\u9032\u7a0b\u751f\u6548\uff0c\u9000\u51fa\u5f8c\uff0c\u8b8a\u91cf\u7121\u6548<br \/>\nexport bash \uff0c\u5168\u5c40\u751f\u6548\uff0c\u4e00\u76f4\u5b58\u5728<br \/>\n\u683c\u5f0f\uff1a<br \/>\nexport key=value<br \/>\nsetenv key value<\/p>\n<p>8).critical<br \/>\n\u8072\u660e\u70ba\u8a2d\u5099\u7684\u5faa\u74b0\u670d\u52d9\u3002\u5982\u679c\u670d\u52d9\u5728\u56db\u5206\u9418\u5167\u9000\u51fa\u4e86\u56db\u6b21\uff0c\u5247\u8a2d\u5099\u6703\u9032\u5165recovery\u6a21\u5f0f<br \/>\n\u4f7f\u7528\u5be6\u4f8bservicemanager\u3001ueventd\u7b49\u670d\u52d9<\/p>\n<p>9).socket [ [ ] ]<br \/>\n\u5275\u5efa\u540d\u70ba\/dev\/socket\/\u7684unix domain socket \uff0c\u4e26\u628a\u5b83\u7684\u53e5\u67c4fd\u50b3\u7d66\u672c\u670d\u52d9\u9032\u7a0b<br \/>\n\u5fc5\u9808\u70ba &#8220;dgram&#8221;, &#8220;stream&#8221; or &#8220;seqpacket&#8221;.User and group default to 0 \uff0c\u4e5f\u5c31\u662froot.<\/p>\n<p>6.command \uff1a\uff08action\u4e0b\u9762\u7684\u4e00\u7cfb\u5217\u547d\u4ee4\uff09<\/p>\n<p>\u5e38\u7528\u547d\u4ee4\uff1a<\/p>\n<p>1).import<br \/>\n\u5c0e\u5165init.XX.rc\u3001xxx.conf\u7b49\u6587\u4ef6<br \/>\nParse an init config file, extending the current configuration.<\/p>\n<p>2).chmod<br \/>\nChange file access permissions.<\/p>\n<p>3).chown<br \/>\nChange file owner and group.<\/p>\n<p>4).chdir<br \/>\nChange working directory.<\/p>\n<p>5).chroot<br \/>\n\u6539\u8b8a\u9032\u7a0b\u6839\u76ee\u9304 <\/p>\n<p>6).insmod<br \/>\n\u52a0\u8f09XX.ko\u9a45\u52d5\u6a21\u584a<\/p>\n<p>7).start<br \/>\nStart a service running if it is not already running.<\/p>\n<p>8).stop<br \/>\nStop a service from running if it is currently running.<\/p>\n<p>9).class_start<br \/>\nStart all services of the specified class if they are not already running.<\/p>\n<p>10).class_stop<br \/>\nStop all services of the specified class if they are currently running.<\/p>\n<p>class_reset \/\/\u91cd\u555fclass\u4e0b\u9762\u6240\u6709\u7684\u670d\u52d9<\/p>\n<p>11).setprop<br \/>\nSet system property to .<br \/>\n\u901a\u904egetprop\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u7576\u524d\u7cfb\u7d71\u7684\u5c6c\u6027\u503c<\/p>\n<p>12).export<br \/>\n\u8a2d\u7f6e\u5168\u5c40\u74b0\u5883\u8b8a\u91cf\uff0c\u9019\u500b\u8b8a\u91cf\u503c\u53ef\u4ee5\u88ab\u6240\u6709\u9032\u7a0b\u8a2a\u554f\uff08\u5168\u5c40\u7684\uff0c\u4e00\u76f4\u5b58\u5728\uff09<br \/>\n\u5728\u4ee3\u78bc\u4e2d\u901a\u904evalue = getenv(&#8220;name&#8221;)\u63a5\u53e3\u53ef\u4ee5\u7372\u53d6\u9019\u500b\u74b0\u5883\u8b8a\u91cf\u7684\u503c <\/p>\n<p>13).mkdir [mode] [owner] [group]<br \/>\n\u5275\u5efa\u76ee\u9304\uff0c\u5f8c\u9762\u9805\u7f3a\u7701\u503c\u70ba mode\uff0cowner\uff0cgroup\uff1a 0755 root root<\/p>\n<p>14).trigger<br \/>\nTrigger an action. Used to queue an action from another action.<br \/>\n\u4f8b\uff1atrigger post-fs-data<\/p>\n<p>15).exec [ ]*<br \/>\n\u57f7\u884c\u6307\u5b9a\u7684Program\uff0c\u4e26\u53ef\u4ee5\u5e36\u6709\u57f7\u884c\u53c3\u6578\u3002<br \/>\nexec\u5728\u8abf\u7528\u9032\u7a0b\u5167\u90e8\u57f7\u884c\u4e00\u500b\u53ef\u57f7\u884c\u6587\u4ef6\uff0c\u4e26\u6703\u963b\u585e\u7576\u524d\u9032\u7a0b\uff0c\u76f4\u5230\u904b\u884c\u5b8c\u6210\u3002<br \/>\n\u6700\u597d\u907f\u514d\u548c\u90a3\u4e9bbuiltin commands\u4e00\u6a23\u4f7f\u7528exec\u547d\u4ee4\uff0c\u5426\u5247\u5bb9\u6613\u9020\u6210\u963b\u585e or stuck ( maybe there should be a timeout?)<\/p>\n<p>16).ifup<br \/>\n\u555f\u52d5\u67d0\u500b\u7db2\u7d61\u63a5\u53e3\uff0c\u4f7f\u5176\u70baup\u72c0\u614b\uff0c\u901a\u904enetcfg\u53ef\u4ee5\u67e5\u770b\uff0cifup eth0 \u7b49\u50f9\u65bc netcfg eth0 up \u529f\u80fd\u4e00\u6a23<\/p>\n<p>17).hostname<br \/>\n\u8a2d\u7f6e\u8a2d\u5099\u7684\u4e3b\u6a5f\u540d\uff0c\u4e00\u822c\u9ed8\u8a8d\u8a2d\u7f6e\u70balocalhost\uff0c\u53ef\u4ee5\u5728\u7d42\u7aef\u901a\u904ehostname new_name\u9032\u884c\u4fee\u6539<\/p>\n<p>18).domainname<br \/>\n\u8a2d\u7f6e\u7db2\u7d61\u57df\u540dlocaldomain<\/p>\n<p>19).mount<\/p>\n<p>[ ]*<br \/>\n\u628adevice\u639b\u63a5\u5230dir\u76ee\u9304\u4e0b\u9762\uff0c\u6587\u4ef6\u7cfb\u7d71\u985e\u578b\u70batype\u3002<br \/>\ns include &#8220;ro&#8221;, &#8220;rw&#8221;, &#8220;remount&#8221;, &#8220;noatime&#8221;, \u300cnosuid\u300d&#8230;&#8230;\uff0c\u5177\u9ad4\u53ef\u67e5\u770blinux\u7684mount\u547d\u4ee4\u8aaa\u660e<\/p>\n<p>20).setkey<br \/>\nTBD == to be determined \u66ab\u6642\u6c92\u6709\u4f7f\u7528<br \/>\n21).setrlimit<br \/>\n\u8a2d\u7f6e\u672c\u670d\u52d9\u9032\u7a0b\u7684\u8cc7\u6e90\u4e0a\u9650\u503c\u3002\uff08\u4f7f\u7528\u4f8b\u5b50\uff1f\uff1f\uff09<\/p>\n<p>22).symlink<br \/>\npath \u93c8\u63a5\u5230 &#8212;\u300btarget \uff1b\u5275\u5efa\u7b26\u865f\u93c8\u63a5<\/p>\n<p>23).sysclktz<br \/>\n\u8a2d\u7f6e\u7cfb\u7d71\u6642\u5340(0 if system clock ticks in GMT)<\/p>\n<p>24).wait [ ]<br \/>\n\u8f2a\u8a62\u67e5\u627e\u7d66\u5b9a\u7684\u6587\u4ef6path\u662f\u5426\u5b58\u5728\uff0c\u5982\u679c\u627e\u5230\u6216\u8005\u8d85\u6642\u5247\u8fd4\u56de\u9ed8\u8a8d\u8d85\u6642\u70ba5\u79d2\u3002\uff08\u4f7f\u7528\u5be6\u4f8b\uff1f\uff1f\uff1f\uff09<\/p>\n<p>25).write [ ]*<br \/>\n\u6253\u958b\u4e00\u500b\u6587\u4ef6\uff0c\u5229\u7528write\u547d\u4ee4\u5beb\u5165\u4e00\u500b\u6216\u591a\u500b\u5b57\u7b26\u4e32<\/p>\n<p>7. Properties<br \/>\n&#8212;&#8212;&#8212;-<br \/>\nInit updates some system properties to provide some insight into<br \/>\nwhat it&#8217;s doing:<\/p>\n<p>init.action<br \/>\nEqual to the name of the action currently being executed or &#8220;&#8221; if none<\/p>\n<p>init.command<br \/>\nEqual to the command being executed or &#8220;&#8221; if none.<\/p>\n<p>init.svc.<br \/>\nState of a named service (&#8220;stopped&#8221;, &#8220;running&#8221;, &#8220;restarting&#8221;)<br \/>\n\u5c6c\u6027\u72c0\u614b\uff0cgetprop\u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u3002property_set\u63a5\u53e3\u51fd\u6578\u3001ctl.start\u3001ctl.stop\u4f86\u8a2d\u7f6e<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f86\u6e90\uff1ahttps:\/\/www.2cto.com\/kf\/201312\/262252.html \u5c0d\u65bcandroid<span class=\"post-excerpt-end\">&hellip;<\/span><\/p>\n<p class=\"more-link\"><a href=\"https:\/\/learn-house.idv.tw\/?p=2392\" class=\"themebutton\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-2392","post","type-post","status-publish","format-standard","hentry","category-5"],"_links":{"self":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/2392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2392"}],"version-history":[{"count":0,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/2392\/revisions"}],"wp:attachment":[{"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/learn-house.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}