{"id":7320,"date":"2023-10-18T11:18:30","date_gmt":"2023-10-18T03:18:30","guid":{"rendered":"https:\/\/blog.hoyo.idv.tw\/?p=7320"},"modified":"2023-10-19T15:54:19","modified_gmt":"2023-10-19T07:54:19","slug":"linux-%e6%9c%89%e6%b2%92%e6%9c%89%e6%8f%92%e7%b6%b2%e8%b7%af%e7%b7%9a-%e6%8f%92%e7%b6%b2%e8%b7%af%e7%b7%9a%e5%81%b5%e6%b8%ac","status":"publish","type":"post","link":"https:\/\/blog.hoyo.idv.tw\/?p=7320","title":{"rendered":"Linux - \u6709\u6c92\u6709\u63d2\u7db2\u8def\u7dda &#038; \u63d2\u7db2\u8def\u7dda\u5075\u6e2c"},"content":{"rendered":"<p>--<\/p>\n<h2>\u89c0\u5ff5\u91d0\u6e05<\/h2>\n<p>\u7db2\u8def\u7dda\u662f\u300c\u7dda\u300d\uff0c\u4e0d\u662f\u786c\u9ad4\u8a2d\u5099\uff0c\u6240\u4ee5\u7121\u6cd5\u4f7f\u7528 udev \u4f86\u6293\u53d6\u72c0\u614b\u3002<\/p>\n<p>\u4e0d\u904e\u56e0\u70ba Linux \u842c\u7269\u7686\u6a94\u6848\uff0c\u6240\u4ee5\u7db2\u8def\u7dda\u662f\u5426\u63d2\u5165\u4e5f\u4e00\u5b9a\u6709\u6a94\u6848\u5c0d\u61c9\uff0c\u4e0b\u9762\u6703\u8aaa\u5230\u3002\u63db\u53e5\u8a71\u8aaa\uff0c\u76e3\u63a7\u7db2\u7ad9\u5167\u5bb9\u4f86\u5f97\u77e5\u7db2\u8def\u7dda\u662f\u5426\u63d2\u5165\u4e5f\u662f\u4e00\u7a2e\u65b9\u5f0f\u3002<\/p>\n<p>--<\/p>\n<h2>\u53c3\u8003\u8cc7\u6e90<\/h2>\n<ul>\n<li><a href=\"https:\/\/b8807053.pixnet.net\/blog\/post\/139241921\" target=\"_blank\" rel=\"noopener\">LINUX \u5075\u6e2c \u6709\u7dda\u7db2\u8def\u63d2\u62d4<\/a><\/li>\n<li><a title=\"\u5728Linux\u4e0a\uff0c\u5982\u4f55\u6aa2\u6e2c\u7269\u7406\u96fb\u7e9c\u662f\u5426\u5df2\u9023\u63a5\u5230\u7db2\u5361\u63d2\u69fd\" href=\"https:\/\/ubuntuqa.com\/zh-tw\/article\/7995.html\" target=\"_blank\" rel=\"noopener\">\u5728Linux\u4e0a\uff0c\u5982\u4f55\u6aa2\u6e2c\u7269\u7406\u96fb\u7e9c\u662f\u5426\u5df2\u9023\u63a5\u5230\u7db2\u5361\u63d2\u69fd<\/a><\/li>\n<li><a class=\"question-hyperlink\" href=\"https:\/\/superuser.com\/questions\/332968\/how-to-configure-eth0-to-retry-dhclient-when-unplugged-and-replugged\" target=\"_blank\" rel=\"noopener\">How to configure `eth0` to retry `dhclient` when unplugged and replugged?<\/a><\/li>\n<li><a class=\"question-hyperlink\" href=\"https:\/\/serverfault.com\/questions\/312282\/ubuntu-server-acquire-an-ip-from-a-newly-connected-dhcp-server-automatically\" target=\"_blank\" rel=\"noopener\">Ubuntu Server: Acquire an IP from a newly connected DHCP server automatically<\/a><\/li>\n<\/ul>\n<p>\u67e5\u770b\u00a0\/sys\/class\/net\/eth0\/carrier \u6a94\u6848\u5167\u5bb9\uff0c 0 \u6c92\u63d2 1 \u6709\u63d2<\/p>\n<p>\u4f7f\u7528 NetworkManager \u6642\uff0c\/etc\/network\/interfaces\u00a0 \u4f7f\u7528\u00a0allow-hotplug eth0<\/p>\n<p>--<\/p>\n<h2>netplug<\/h2>\n<ul>\n<li><a href=\"https:\/\/linux.die.net\/man\/8\/netplugd\" target=\"_blank\" rel=\"noopener\">netplugd(8) - Linux man page<\/a><\/li>\n<\/ul>\n<p>\u5b89\u88dd<\/p>\n<pre class=\"lang:default decode:true\"># apt-get install netplug<\/pre>\n<p>\u7de8\u8f2f \/etc\/netplug\/netplug<\/p>\n<pre class=\"lang:default decode:true\"># vi \/etc\/netplug\/netplug\r\n:\r\n:\r\ncase \"$action\" in\r\nin)\r\n    # \/opt\/Gateway\/network.sh\r\n    # systemctl restart 1.web\r\n    ;;\r\nout)\r\n    ;;\r\nprobe)\r\n    #exec \/sbin\/ip link set \"$dev\" up &gt;\/dev\/null 2&gt;&amp;1\r\n    ;;\r\n*)\r\n    echo \"I have been called with a funny action of '%s'!\" 1&gt;&amp;2\r\n    exit 1\r\n    ;;\r\nesac<\/pre>\n<p>--<\/p>\n<h2>\u4f7f\u7528\u00a0Inotify \u76e3\u63a7\u6a94\u6848\u5167\u5bb9<\/h2>\n<ul>\n<li><a href=\"https:\/\/man.linuxde.net\/inotifywait\" target=\"_blank\" rel=\"noopener\">inotifywait\u547d\u4ee4<\/a><\/li>\n<\/ul>\n<p>--<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"7320\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;4,062&nbsp;total views<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>-- \u89c0\u5ff5\u91d0\u6e05 \u7db2\u8def\u7dda\u662f\u300c\u7dda\u300d...<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p class=\"pvc_stats all \" data-element-id=\"7320\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> &nbsp;4,062&nbsp;total views<\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[26],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/7320"}],"collection":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7320"}],"version-history":[{"count":11,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/7320\/revisions"}],"predecessor-version":[{"id":12773,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=\/wp\/v2\/posts\/7320\/revisions\/12773"}],"wp:attachment":[{"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hoyo.idv.tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}