{"id":2062,"date":"2022-11-14T10:00:42","date_gmt":"2022-11-14T02:00:42","guid":{"rendered":"https:\/\/www.yusian.com\/blog\/?p=2062"},"modified":"2025-04-06T13:56:27","modified_gmt":"2025-04-06T05:56:27","slug":"linux%e4%b8%8b%e5%a6%82%e4%bd%95%e5%88%9b%e5%bb%ba%e9%9a%8f%e6%9c%ba%e5%90%af%e5%8a%a8%e4%bb%bb%e5%8a%a1","status":"publish","type":"post","link":"https:\/\/www.yusian.com\/blog\/centos\/2022\/11\/14\/1000422062.html","title":{"rendered":"Linux\u4e0b\u5982\u4f55\u521b\u5efa\u968f\u673a\u542f\u52a8\u4efb\u52a1"},"content":{"rendered":"<h2>\u65b9\u6cd5\u4e00\uff1arc.local<\/h2>\n<ul>\n<li>\u6700\u7b80\u5355\u4e14\u6bd4\u8f83\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u5728\/etc\/rc.local\uff08<code>\/etc\/rc.d\/rc.local<\/code>\uff09\u6587\u4ef6\u4e2d\u6dfb\u52a0\u811a\u672c\uff0c\u8be5\u811a\u672c\u4f1a\u5728\u542f\u52a8\u65f6\u88ab\u8c03\u7528\uff0c\u5982\u6b64\u4ee5\u6765\u5c31\u80fd\u5b9e\u73b0\u968f\u673a\u542f\u52a8\u7684\u76ee\u7684<\/li>\n<\/ul>\n<h2>\u65b9\u6cd5\u4e8c\uff1asystemctl<\/h2>\n<ul>\n<li>systemctl\u662flinux\u64cd\u4f5c\u7cfb\u7edf\u7684\u7cfb\u7edf\u63a7\u5236\u5668\uff0c\u4ed6\u53ef\u4ee5\u7ba1\u7406\u7cfb\u7edf\u7684\u5404\u79cd\u670d\u52a1\uff0c\u5176\u5b9e\u65b9\u6cd5\u4e00\u7684\u672c\u8d28\u662f\u5728systemctl\u4e2d\u6ce8\u518c\u4e86\u4e00\u4e2arc-local.service\u7684\u670d\u52a1\uff0c\u8fd9\u4e2a\u670d\u52a1\u4e2d\u4f1a\u8c03\u7528\/etc\/rc.local\u4e2d\u7684\u811a\u672c\uff0c\u7136\u540e\u8fd9\u4e2a\u670d\u52a1\u4f1a\u968f\u673a\u542f\u52a8<\/p>\n<\/li>\n<li>\n<p>\u5982\u4f55\u6ce8\u518c\u4e00\u4e2asystemctl\u670d\u52a1\uff1f\u53ea\u8981\u5728\/etc\/systemd\/system\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2axxx.service\u7684\u6587\u4ef6\u5373\u53ef\uff0c\u6211\u4eec\u770b\u770brc-local.service\u662f\u5982\u4f55\u7f16\u5199\u7684<\/p>\n<pre><code class=\"language-shell line-numbers\">#  SPDX-License-Identifier: LGPL-2.1+\n#\n#  This file is part of systemd.\n#\n#  systemd is free software; you can redistribute it and\/or modify it\n#  under the terms of the GNU Lesser General Public License as published by\n#  the Free Software Foundation; either version 2.1 of the License, or\n#  (at your option) any later version.\n\n# This unit gets pulled automatically into multi-user.target by\n# systemd-rc-local-generator if \/etc\/rc.d\/rc.local is executable.\n[Unit]\nDescription=\/etc\/rc.d\/rc.local Compatibility\nDocumentation=man:systemd-rc-local-generator(8)\nConditionFileIsExecutable=\/etc\/rc.d\/rc.local\nAfter=network.target\n\n[Service]\nType=forking\nExecStart=\/etc\/rc.d\/rc.local start\nTimeoutStartSec=0\nTimeoutStopSec=30\nRemainAfterExit=yes\nGuessMainPID=no\n<\/code><\/pre>\n<\/li>\n<li>\u6700\u57fa\u672c\u6700\u7b80\u5355\u7684service\u6587\u4ef6\n<pre><code class=\"language-shell line-numbers\">[Unit]\nDescription=Frp Client Service\nAfter=network-online.target\nWants=network-online.target\n[Service]\nType=forking\nExecStart=\/...\n[Install]\nWantedBy=multi-user.target\n<\/code><\/pre>\n<\/li>\n<li>\u8bbe\u7f6e\u597d\u4e86service\u6587\u4ef6\u540e\uff0c\u9700\u8981\u968f\u673a\u542f\u52a8\u8fd8\u9700\u8981\u6267\u884c\u4e00\u884c\u547d\u4ee4\n<pre><code class=\"language-shell line-numbers\">~:$ systemctl enable xxx\n<\/code><\/pre>\n<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u65b9\u6cd5\u4e00\uff1arc.local \u6700\u7b80\u5355\u4e14\u6bd4\u8f83\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u5728\/etc\/rc.local\uff08\/etc\/rc.d\/rc.local\uff09\u6587\u4ef6\u4e2d\u6dfb\u52a0\u811a\u672c\uff0c\u8be5\u811a\u672c\u4f1a\u5728\u542f\u52a8\u65f6\u88ab\u8c03\u7528\uff0c\u5982\u6b64\u4ee5\u6765\u5c31\u80fd\u5b9e\u73b0\u968f\u673a\u542f\u52a8\u7684\u76ee\u7684 \u65b9\u6cd5\u4e8c\uff1asystemctl systemctl\u662flinux\u64cd\u4f5c\u7cfb\u7edf\u7684\u7cfb\u7edf\u63a7\u5236\u5668\uff0c\u4ed6\u53ef\u4ee5\u7ba1\u7406\u7cfb\u7edf\u7684\u5404\u79cd\u670d\u52a1\uff0c\u5176\u5b9e\u65b9\u6cd5\u4e00\u7684\u672c\u8d28\u662f\u5728systemctl\u4e2d\u6ce8\u518c\u4e86\u4e00\u4e2arc-local.service\u7684\u670d\u52a1\uff0c\u8fd9\u4e2a\u670d\u52a1\u4e2d\u4f1a\u8c03\u7528\/etc\/rc.local\u4e2d\u7684\u811a\u672c\uff0c\u7136\u540e\u8fd9\u4e2a\u670d\u52a1\u4f1a\u968f\u673a\u542f\u52a8 \u5982\u4f55\u6ce8\u518c\u4e00\u4e2asystemctl\u670d\u52a1\uff1f\u53ea\u8981\u5728\/etc\/systemd\/system\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2axxx.service\u7684\u6587\u4ef6\u5373\u53ef\uff0c\u6211\u4eec\u770b\u770brc-local.service\u662f\u5982\u4f55\u7f16\u5199\u7684 # SPDX-License-Identifier: LGPL-2.1+ # # This file is part of systemd. # # systemd is free software; you can redistribute it and\/or modify it # under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation; either version 2.1 of the License, or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21,386],"tags":[8,395],"class_list":["post-2062","post","type-post","status-publish","format-standard","hentry","category-centos","category-ubuntu","tag-linux","tag-395"],"_links":{"self":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/2062","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/comments?post=2062"}],"version-history":[{"count":0,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/posts\/2062\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/media?parent=2062"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/categories?post=2062"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yusian.com\/blog\/wp-json\/wp\/v2\/tags?post=2062"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}