{"id":270605,"date":"2023-04-24T20:17:23","date_gmt":"2023-04-24T12:17:23","guid":{"rendered":"https:\/\/gulass.cn\/lxtfwdqdjstg.html"},"modified":"2023-04-24T20:17:23","modified_gmt":"2023-04-24T12:17:23","slug":"lxtfwdqdjstg","status":"publish","type":"post","link":"https:\/\/gulass.cn\/lxtfwdqdjstg.html","title":{"rendered":"Linux\u7cfb\u7edf\u670d\u52a1\u7684\u542f\u52a8\u5c31\u662f\u901a\u8fc7\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\u5b9e\u73b0\u7684"},"content":{"rendered":"

linux\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8,\u7b2c1\u5f20<\/p>\n

linux\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8\u6267\u884c\u547d\u4ee4<\/a>\uff1a<\/p>\n

\u6267\u884c\u547d\u4ee4\uff1a\u7f16\u8f91\"\/etc\/rc.local\"\uff0c\u6dfb\u52a0\u4f60\u60f3\u5f00\u673a\u8fd0\u884c\u7684\u547d\u4ee4<\/p>\n

\u8fd0\u884c\u7a0b\u5e8f\u811a\u672c\uff1a\u4e4b\u540e\u5728\u6587\u4ef6\u6700\u540e\u4e00\u884c\u6dfb\u52a0\u8981\u6267\u884c\u7a0b\u5e8f\u7684\u5168\u8def\u5f84\u3002<\/p>\n

\u6bd4\u5982\uff0c\u6bcf\u6b21\u5f00\u673a\u65f6\u8981\u6267\u884c\u4e00\u4e2ahello.sh\uff0c\u8fd9\u4e2a\u811a\u672c\u7f6e\u4e8e\/usr\u4e0b\u8fb9\uff0c\u90a3\u5c31\u53ef\u4ee5\u5728\"\/etc\/rc.local\"\u4e2d\u52a0\u4e00\u884c\"\/usr\/.\/hello.sh\"\uff0c\u6216\u5219\"cd\/opt&amp&amp.\/hello.sh\"<\/p>\n

\u6ce8\u610f\uff0c\u4f60\u7684\u547d\u4ee4\u5e94\u5f53\u6dfb\u52a0\u5728\uff1aexit0\u4e4b\u524d<\/p>\n

linux\u5728\u201c\/etc\/rc.d\/init.d\u201d\u4e0b\u6709\u597d\u591a\u7684\u6587\u4ef6\uff0c\u6bcf\u4f4d\u6587\u4ef6\u90fd\u662f\u53ef\u4ee5\u542c\u5230\u5185\u5bb9\u7684\uff0c\u867d\u7136\u90fd\u662f\u4e00\u4e9bshell\u811a\u672c\u6216\u5219\u53ef\u6267\u884c\u4e8c\u8865\u7801\u6587\u4ef6Linux<\/a>\u5f00\u673a\u7684\u65f6\u4faf\uff0c\u4f1a\u52a0\u8f7d\u8fd0\u884c\/etc\/init.d\u76ee\u5f55\u4e0b\u7684\u7a0b\u5e8f\uff0c\u56e0\u800c\u6211\u4eec\u53ef\u4ee5\u628a\u60f3\u8981\u624b\u52a8\u8fd0\u884c\u7684\u811a\u672c\u653e\u5728\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u5373\u53ef\u3002\u7cfb\u7edf<\/a>\u670d\u52a1\u7684\u542f\u52a8\u5c31\u662f\u901a\u8fc7\u8fd9\u4e9b\u65b9\u6cd5\u5b9e\u73b0\u7684\u3002<\/p>\n

\u7b80\u5355\u7684\u8bf4\uff0c\u8fd0\u884c\u7ea7\u5c31\u662f\u64cd\u4f5c\u7cfb\u7edf\u5f53\u524d\u6b63\u5728\u8fd0\u884c\u7684\u529f\u80fd\u7ea7\u522b\u3002<\/p>\n

\u4f8b\uff1a\u5728Ubuntu\/debain\u91cc\uff0c\u53ef\u4ee5\u4f7f\u7528update-rc.d\u547d\u4ee4\u6765\u628a\u793a\u4f8b\u811a\u672c\uff1a\/etc\/init.d\/proxy\u5b89\u88c5\u5230\u5404\u4e2arunlevel\u4e2d\u3002<\/p>\n

update-rc.d\u524d\u9762\u6709\u4e09\u4e2a\u53c2\u6570\uff0c\u5206\u522b\u662f\/etc\/init.d\u4e0b\u7684\u811a\u672c\u540d\u5b50\uff0c\u9ed8\u8ba4\u5b89\u88c5\u65b9\u6cd5\uff0c\u8fd0\u884c\u7684\u4f18\u5148\u7ea7\u3002\u4f18\u5148\u7ea7\u7684\u6570\u5b57\u8d8a\u5927\uff0c\u8868\u793a\u8d8a\u8fdf\u8fd0\u884c\uff0c\u8fd9\u513f\u6211\u4eec\u628a\u81ea\u5df1\u5199\u7684\u670d\u52a1\u653e\u5230\u6700\u540e\u8fd0\u884c\u3002<\/p>\n

\u5047\u5982\u8981\u5378\u8f7d\u968f\u673a\u542f\u52a8\u7684\u670d\u52a1\uff0c\u6267\u884c<\/p>\n

\u5728update-rc.d\u5b89\u88c5\u7684\u65f6\u4faf\u63d0\u793a\u4e86\u8b66\u544a\u4fe1\u606f\uff0c\u662f\u7531\u4e8e\u6211\u4eec\u5199\u7684\/etc\/init.d\/proxy\u592a\u72ed\u5c0f\u4e86linux\u591a\u7ebf\u7a0b\uff0c\u53ea\u5305\u542b\u4e86\u6211\u4eec\u60f3\u8981\u7684\u547d\u4ee4\uff0c\u8fdeLSB\u7684\u4fe1\u606f\u4e5f\u6ca1\u6709\u63d0\u4f9b\u3002<\/p>\n

\u53ea\u987b\u8981\u5bf9\u81ea\u542f\u52a8\u811a\u672c\u505a\u4e00\u4e9b\u5c0f\u6539\u52a8\uff0c\u5c31\u53ef\u4ee5\u9632\u6b62\u90a3\u79cd\u8b66\u544a\u4e86\u3002\u5982\u4e0b\uff1a<\/p>\n

\u5230\u6b64\uff0c\u4e00\u4e2a\u6700\u7b80\u5355\u7684\u968f\u673a\u542f\u52a8\u670d\u52a1\u5199\u597d\u4e86\uff0c\u770b\u4e0a\u53bb\u6587\u7ae0\u633a\u957f\u7684\uff0c\u4f46\u663e\u7136\u4e5f\u5c31\u51e0\u4e2a\u547d\u4ee4\u800c\u5df2\u3002\u5728\u4e0a\u6b21\u5f00\u673a\u542f\u52a8\u7684\u65f6\u4faf\uff0cproxy.py\u90fd\u4f1a\u4ee5root\u7528\u6237\u8eab\u5206\u88ab\u624b\u52a8\u8fd0\u884c\u3002<\/p>\n

\u5728\/etc\/init.d\u4e0b\u65b0\u5efa\u793a\u4f8b\u811a\u672c\u6587\u4ef6\uff08startTest.sh\uff09\uff0c\u8be5\u811a\u672c\u4f1a\u542f\u52a8\/opt\/test.sh\u3002\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n

\u5199\u4e86\u811a\u672c\u6587\u4ef6\u7136\u540e\u4e8b\u60c5\u8fd8\u6ca1\u6709\u5b8c\uff0c\u7ee7\u7eed\u5b8c\u6210\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a<\/p>\n

\u7a76\u7adf\u4ec0\u4e48\u670d\u52a1\u9002\u5b9c\u5f00\u673a\u81ea\u542f\u52a8\uff1f\u662f\u597d\u591aLinux\u8fd0\u7ef4\u5728\u5de5\u4f5c\u4e2d\u4f1a\u78b0\u5230\u7684\u95ee\u9898\u3002\u867d\u7136\uff0c\u53ea\u8981\u4e0d\u5f71\u54cd\u7cfb\u7edf\u53ca\u670d\u52a1\u7684\u8fd0\u884c\uff0c\u5f00\u591a\u5f00\u5c11\u4e5f\u6ca1\u5173\u7cfb\u3002Linux\u8fd0\u7ef4\u4eba\u5458\u8981\u660e\u6670\u6bcf\u9879\u670d\u52a1\u7684\u4f5c\u7528\uff0c\u4e0d\u7528\u7684\u5c31\u4e0d\u5b89\u88c5linux \u7a0b\u5e8f\u5f00\u673a\u81ea\u542f\u52a8<\/strong>\uff0c\u9ed8\u8ba4\u5b89\u88c5\u65f6\u5219\u4e0d\u5f00\u673a\u81ea\u542f\u52a8\u3002\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8\u670d\u52a1\u7684\u5e38\u89c1\u65b9\u5f0f\u6709\u4ec0\u4e48\uff1f<\/p>\n

1\uff09\u6267\u884c\u547d\u4ee4\uff0c\u4e4b\u540e\u81ea\u52a8\u9009\u62e9\u5904\u7406\u7684\u65b9\u5f0f<\/p>\n

\u65b9\u5f0f1\uff1a\u6267\u884cntsysv\u547d\u4ee4\uff0c\u4e4b\u540e\u5728\u5f39\u51fa\u7a97\u53e3\u8fdb\u884c\u8bbe\u7f6e\u3002<\/p>\n

\u65b9\u5f0f2\uff1a\u6267\u884csetup\u547d\u4ee4\u2192systemservice\uff0c\u4e4b\u540e\u5728\u5f39\u51fa\u7a97\u53e3\u4e2d\u8fdb\u884c\u8bbe\u7f6e\u3002<\/p>\n

2\uff09\u901a\u8fc7\u4e00\u884c\u547d\u4ee4\u6216She11\u811a\u672c\u8bbe\u7f6e<\/p>\n

\u628a\u67d0\u4e2a\u7a0b\u5e8f\u8bbe\u7f6e\u5f00\u673a\u542f\u52a8_win7 \u7a0b\u5e8f\u5f00\u673a\u542f\u52a8_linux \u7a0b\u5e8f\u5f00\u673a\u81ea\u542f\u52a8<\/p>\n

\u5728\u5feb\u901f\u8bbe\u7f6e\u524d\uff0c\u5148\u67e5\u770b\u9ed8\u8ba4\u60c5\u51b5\u4e0bLinux\u7cfb\u7edf\u5f00\u542f\u7684\u670d\u52a1\u6709\u4ec0\u4e48\u3002\u5047\u5982\u5de5\u4f5c\u5728\u6587\u672c\u6a21\u5f0f3\u7ea7\u522b\uff0c\u90a3\u5c31\u53ea\u987b\u8981\u67e5\u627e3\u7ea7\u522b\u4e0a\u5f00\u542f\u7684\u670d\u52a1\u5373\u53ef\u3002\u4e86\u89e3\u4e86\u7cfb\u7edf\u57283\u7ea7\u522b\u4e0a\u5f00\u542f\u7684\u670d\u52a1\u540e\uff0c\u5c31\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u5feb\u901f\u5b9e\u73b0\u914d\u7f6e\u4e86\u3002\u4ee5\u4e0b\u4fbf\u662f\u51e0\u79cd\u901a\u8fc7\u547d\u4ee4\u6216\u811a\u672c\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8\u7684\u65b9\u5f0f\u3002<\/p>\n

1\uff1a\u5148\u5168\u5173\u6389\uff0c\u518d\u5f00\u542f\u987b\u8981\u4fdd\u7559\u7684\u3002<\/p>\n

2\uff1a\u4e00\u6761\u547d\u4ee4\u641e\u5b9a\uff0cShell\u5faa\u73af\u5b9e\u73b0\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u987b\u8981\u4fdd\u7559\u7684\u670d\u52a1\u90fd\u5df2\u5f00\u542flinux \u7a0b\u5e8f\u5f00\u673a\u81ea\u542f\u52a8<\/strong>\uff0c\u4e3a\u6b64\uff0c\u5173\u63893\u7ea7\u522b\u6587\u672c\u6a21\u5f0f\u4e0b\u5df2\u5f00\u542f\u4f46\u53c8\u4e0d\u987b\u8981\u7684\u670d\u52a1\u5c31\u597d\u4e86\u3002<\/p>\n

3\uff1a\u4e0d\u8981Shell\u5faa\u73af\u53e5\u5b50\u4e5f\u4e00\u6761\u547d\u4ee4\u641e\u5b9a\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u8981\u4fdd\u7559\u7684\u670d\u52a1\u90fd\u5df2\u5f00\u542f\uff0c\u4e3a\u6b64linux\u662f\u4ec0\u4e48\u7cfb\u7edf\uff0c\u5173\u63893\u7ea7\u522b\u6587\u672c\u6a21\u5f0f\u4e0b\u5df2\u5f00\u542f\u4f46\u53c8\u4e0d\u987b\u8981\u7684\u670d\u52a1\u5c31\u597d\u4e86\uff0c\u4e0d\u7528\u5faa\u73af\u7ed3\u6784\u800c\u662f\u501f\u52a9\u547d\u4ee4\u62fc\u51fa\u6240\u6709\u8981\u5904\u7406\u7684\u547d\u4ee4\u5b57\u7b26\u4e32\uff0c\u901a\u8fc7bash\u5c06\u5176\u5f53\u505a\u547d\u4ee4\u6267\u884c\u3002<\/p>\n

\u8fd9\u4e48\u7a76\u7adf\u5c06\u4ec0\u4e48\u670d\u52a1\u4f5c\u4e3a\u5f00\u673a\u81ea\u542f\u52a8\u670d\u52a1\u5408\u9002\uff1f\u4f46\u4f5c\u4e3a\u4e00\u540d\u4f18\u79c0\u7684Linux\u7cfb\u7edf\u7ba1\u7406\u5458\uff0c\u5e94\u5f53\u9075\u5faa\u6700\u5c0f\u5316\u539f\u5219\uff0c\u5c3d\u91cf\u4e0d\u5b89\u88c5\u4e0d\u4f7f\u7528\u7684\u8f6f\u4ef6\u3001\u4e0d\u5f00\u542f\u4e0d\u987b\u8981\u7684\u670d\u52a1\uff1b\u8fd9\u6837\u7cfb\u7edf\u7684\u6027\u80fd\u548c\u5b89\u5168\u6027\u624d\u662f\u6700\u597d\u7684\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

local\uff0c\u6dfb\u52a0\u4f60\u60f3\u5f00\u673a\u8fd0\u884c\u7684\u547d\u4ee4Linux\u5f00\u673a\u7684\u65f6\u5019\uff0c\u4f1a\u52a0\u8f7d\u8fd0\u884c\/etc\/init.\u5982\u679c\u8981\u5378\u8f7d\u968f\u673a\u542f\u52a8\u7684\u670d\u52a1\uff0c\u6267\u884c\u5728\u4e0b\u6b21\u5f00\u673a\u542f\u52a8\u7684\u65f6\u5019\uff0cproxy.\u5230\u5e95\u54ea\u4e9b\u670d\u52a1\u9002\u5408\u5f00\u673a\u81ea\u542f\u52a8\uff1fLinux\u8fd0\u7ef4\u4eba\u5458\u8981\u660e\u786e\u6bcf\u9879\u670d\u52a1\u7684\u4f5c\u7528\uff0c\u4e0d\u7528\u7684\u5c31\u4e0d\u5b89\u88c5\uff0c\u9ed8\u8ba4\u5b89\u88c5\u65f6\u5219\u4e0d\u5f00\u673a\u81ea\u542f\u52a8\u3002\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8\u670d\u52a1\u7684\u5e38\u89c1\u65b9\u6cd5\u6709\u54ea\u4e9b\uff1f\u4ee5\u4e0b\u4fbf\u662f\u51e0\u79cd\u901a\u8fc7\u547d\u4ee4\u6216\u811a\u672c\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8\u7684\u65b9\u6cd5\u3002\u90a3\u4e48\u5230\u5e95\u5c06\u54ea\u4e9b\u670d\u52a1\u4f5c\u4e3a\u5f00\u673a\u81ea\u542f\u52a8\u670d\u52a1\u5408\u9002\uff1f<\/p>\n","protected":false},"author":1,"featured_media":270606,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-270605","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/270605","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=270605"}],"version-history":[{"count":0,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/270605\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/270606"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=270605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=270605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=270605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}