{"id":288617,"date":"2023-12-02T04:01:21","date_gmt":"2023-12-01T20:01:21","guid":{"rendered":"https:\/\/lrxjmw.cn\/ljsjsxzdhxhg.html"},"modified":"2023-12-02T04:01:21","modified_gmt":"2023-12-01T20:01:21","slug":"ljsjsxzdhxhg","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/ljsjsxzdhxhg.html","title":{"rendered":"Linux\u8ba1\u7b97\u673a\u5b9e\u73b0\u81ea\u52a8\u5524\u9192\u548c\u5173\u95ed\u7684\u65b9\u5f0f\u662f\u600e\u6837\u7684\uff1f"},"content":{"rendered":"

\u4e0d\u8981\u6210\u4e3a\u4e00\u4e2a\u7535\u80fd\u6d6a\u8d39\u8005\u3002\u5047\u5982\u4f60\u7684\u7b14\u8bb0\u672c\u4e0d\u987b\u8981\u5f00\u673a\u5c31\u8bf7\u628a\u5b83\u4eec\u6b7b\u673a\u3002\u51fa\u4e8e\u4fbf\u6377\u548c\u8ba1\u7b97\u673a<\/a>\u5b85\u7684\u8003\u8651\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u4f60\u7684Linux<\/a>\u8ba1\u7b97\u673a\u5b9e\u73b0\u624b\u52a8\u5524\u8d77\u548c\u5173\u6389\u3002<\/p>\n

\u5b9d\u8d35\u7684\u7cfb\u7edf<\/a>\u8fd0\u884c\u65f6\u95f4<\/p>\n

\u6709\u65f6\u4faf\u6709\u4e9b\u7b14\u8bb0\u672c\u987b\u8981\u4ecd\u7136\u5904\u5728\u5f00\u673a\u72b6\u6001\uff0c\u5728\u4e0d\u8d85\u8fc7\u7b14\u8bb0\u672c\u8fd0\u884c\u65f6\u95f4\u7684\u9650\u5236\u4e0b\u8fd9\u4e9b\u60c5\u51b5\u662f\u88ab\u5bb9\u8bb8\u7684\u3002\u6709\u4e9b\u4eba\u4e3a\u5979\u4eec\u7684\u8ba1\u7b97\u673a\u53ef\u4ee5\u957f\u65f6\u95f4\u7684\u6b63\u5e38\u8fd0\u884c\u800c\u500d\u611f\u81ea\u8c6a\uff0c\u4e14\u73b0\u4eca\u6211\u4eec\u6709\u5185\u6838\u70ed\u8865\u4e01\u5c31\u80fd\u5b9e\u73b0\u53ea\u6709\u5728\u786c\u4ef6\u53d1\u751f\u6545\u969c\u65f6\u624d\u987b\u8981\u673a\u5668\u6b7b\u673a\u3002\u6211\u89c9\u5f97\u6bd4\u8f83\u5b9e\u9645\u53ef\u884c\u7684\u662f\uff0c\u50cf\u964d\u4f4e\u8054\u901a\u90e8\u4ef6\u9508\u8680\u4e00\u6837\u8282\u8282\u7535\u80fd\uff0c\u4e14\u5728\u4e0d\u987b\u8981\u673a\u5668\u8fd0\u884c\u7684\u60c5\u51b5\u4e0b\u5c06\u5176\u6b7b\u673a\u3002\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u5728\u89c4\u5b9a\u7684\u65f6\u95f4\u5185\u5524\u8d77\u5907\u4efd\u670d\u52a1\u5668\uff0c\u6267\u884c\u5907\u4efd\uff0c\u4e4b\u540e\u5173\u6389\u5b83\u76f4\u81f3\u5b83\u8981\u8fdb\u884c\u4e0b\u4e00\u6b21\u5907\u4efd\u3002\u6216\u5219\uff0c\u4f60\u53ef\u4ee5\u8bbe\u7f6e\u4f60\u7684\u4e92\u8054\u7f51\u7f51\u6bb5\u53ea\u5728\u7279\u5b9a\u7684\u65f6\u95f4\u8fd0\u884c\u3002\u4efb\u4f55\u4e0d\u987b\u8981\u4ecd\u7136\u8fd0\u884c\u7684\u4e1c\u897f\u90fd\u53ef\u4ee5\u5c06\u5176\u914d\u7f6e\u6210\u5728\u5176\u987b\u8981\u5de5\u4f5c\u7684\u65f6\u4faf\u6253\u5f00\uff0c\u5f85\u5176\u5b8c\u6210\u5de5\u4f5c\u540e\u5c06\u5176\u5173\u6389\u3002<\/p>\n

\u7cfb\u7edf\u4f11\u7720<\/p>\n

\u5bf9\u4e8e\u4e0d\u987b\u8981\u4ecd\u7136\u8fd0\u884c\u7684\u7b14\u8bb0\u672c\uff0c\u4f7f\u7528root\u7684cron\u5b9a\u65f6\u4efb\u52a1\uff08\u5373\/etc\/crontab\uff09\u53ef\u4ee5\u53ef\u9760\u5730\u5173\u6389\u7b14\u8bb0\u672c\u3002\u8fd9\u4e2a\u4e8b\u4f8b\u521b\u5efa\u4e00\u4e2aroot\u5b9a\u65f6\u4efb\u52a1\u5b9e\u73b0\u6bcf\u665a\u4e0b\u534811\u70b915\u5206\u5b9a\u65f6\u6b7b\u673a\u3002<\/p>\n

#crontab-e-uroot#mhdommondowcommand1523***\/sbin\/shutdown-hnow<\/p>\n

\u4ee5\u4e0b\u793a\u4f8b\u4ec5\u5728\u5468\u65e5\u81f3\u5468\u56db\u8fd0\u884c\uff1a<\/p>\n

linux\u7cfb\u7edf\u5982\u4f55\u5173\u673a_\u5173\u673a\u7cfb\u7edf\u81ea\u52a8\u8fd8\u539f_\u5173\u673a\u7cfb\u7edf\u66f4\u65b0\u600e\u4e48\u53d6\u6d88<\/p>\n

1523**1-5\/sbin\/shutdown-hnow<\/p>\n

\u60a8\u53ef\u4ee5\u4e3a\u4e0d\u540c\u7684\u65e5\u671f\u548c\u65f6\u95f4\u521b\u5efa\u591a\u4e2acron\u4f5c\u4e1a\u3002\u901a\u8fc7\u547d\u4ee4<\/a>man5crontab\u53ef\u4ee5\u4e86\u89e3\u6240\u6709\u65f6\u95f4\u548c\u65e5\u671f\u7684\u4e3b\u952e\u3002<\/p>\n

\u4e00\u4e2a\u5feb\u901f\u3001\u5bb9\u6613\u7684\u65b9\u6cd5\u662f\uff0c\u4f7f\u7528\/etc\/crontab\u6587\u4ef6\u3002\u4f46\u8fd9\u6837\u4f60\u5fc5\u987b\u6307\u5b9a\u7528\u6237\uff1a<\/p>\n

1523**1-5rootshutdown-hnow<\/p>\n

\u624b\u52a8\u5524\u8d77<\/p>\n

\u5173\u673a\u7cfb\u7edf\u81ea\u52a8\u8fd8\u539f_\u5173\u673a\u7cfb\u7edf\u66f4\u65b0\u600e\u4e48\u53d6\u6d88_linux\u7cfb\u7edf\u5982\u4f55\u5173\u673a<\/p>\n

\u5b9e\u73b0\u624b\u52a8\u5524\u8d77\u662f\u4e00\u4ef6\u5f88\u9177\u7684\u4e8b\u60c5\uff1b\u6211\u5927\u591a\u6570SUSE\uff08SUSELinux\uff09\u7684\u540c\u5b66\u90fd\u5728\u6155\u5c3c\u9ed1\uff0c\u4e3a\u6b64\uff0c\u56e0\u800c\u4e3a\u4e86\u8ddf\u670b\u53cb\u80fd\u6709\u51e0\u5c0f\u65f6\u4e00\u8d77\u5de5\u4f5c\u7684\u65f6\u95f4\uff0c\u6211\u4e0d\u5f97\u4e0d\u987b\u8981\u5728\u508d\u665a\u4e94\u70b9\u65e9\u8d77\u3002\u6211\u7684\u8ba1\u7b97\u673a\u4e0b\u53485\u70b9\u534a\u624b\u52a8\u5f00\u59cb\u5de5\u4f5c\uff0c\u800c\u6211\u53ea\u987b\u8981\u5c06\u81ea\u5df1\u548c\u5976\u8336\u62d6\u5230\u6211\u7684\u6905\u5b50\u4e0a\u5c31\u53ef\u4ee5\u5f00\u59cb\u5de5\u4f5c\u4e86\u3002\u6309\u4e0b\u7535\u6e90\u6309\u952e\u770b\u4e0a\u53bb\u4f3c\u4e4e\u5e76\u4e0d\u662f\u54ea\u4e9b\u5927\u4e8b\uff0c\u5e76\u4e14\u5728\u6bcf\u665a\u7684\u90a3\u79cd\u65f6\u4faf\u6bcf\u4ef6\u5c0f\u4e8b\u5c31\u4f1a\u663e\u5f97\u5f88\u5927\u3002<\/p>\n

\u5524\u8d77Linux\u8ba1\u7b97\u673a\u53ef\u80fd\u4e0d\u5982\u5173\u6389\u5b83\u53ef\u9760\uff0c\u56e0\u800c\u4f60\u53ef\u80fd\u987b\u8981\u5c1d\u8bd5\u4e0d\u540c\u7684\u529e\u6cd5\u3002\u4f60\u53ef\u4ee5\u4f7f\u7528\u8fdc\u7a0b\u5524\u8d77\uff08Wake-On-LAN\uff09\u3001RTC\u5524\u8d77\u6216\u5219\u4e2a\u4eba\u7b14\u8bb0\u672c\u7684BIOS\u8bbe\u7f6e\u9884\u5b9a\u7684\u5524\u8d77\u8fd9\u79cd\u5f62\u5f0f\u3002\u8fd9\u79cd\u65b9\u6cd5\u53ef\u884c\u7684\u7f18\u7531\u662flinux\u7cfb\u7edf\u5982\u4f55\u5173\u673a<\/strong>\uff0c\u5f53\u4f60\u5173\u6389\u7b14\u8bb0\u672c\u65f6linux\u7cfb\u7edf\u5982\u4f55\u5173\u673a<\/strong>\uff0c\u8fd9\u5e76\u4e0d\u662f\u771f\u6b63\u5173\u6389\u4e86\u8ba1\u7b97\u673a\uff1b\u6b64\u65f6\u8ba1\u7b97\u673a\u5904\u5728\u6781\u4f4e\u5e27\u7387\u72b6\u6001\u4e14\u8fd8\u53ef\u4ee5\u63a5\u53d7\u548c\u54cd\u5e94\u8baf\u53f7\u3002\u53ea\u6709\u5728\u4f60\u62d4\u9664\u7535\u6e90\u5f00\u5173\u65f6\u5176\u624d\u5f7b\u5e95\u5173\u6389\u3002<\/p>\n

BIOS\u5524\u8d77<\/p>\n

BIOS\u5524\u8d77\u662f\u6700\u53ef\u9760\u7684\u3002\u6211\u7684\u7cfb\u7edf\u663e\u5361BIOS\u6709\u4e00\u4e2a\u4fbf\u4e8e\u4f7f\u7528\u7684\u5524\u8d77\u8c03\u5ea6\u7a0b\u5e8f(\u56fe1)\u3002\u5bf9\u4f60\u6765\u8bf4\u4e5f\u662f\u4e00\u6837\u7684\u5bb9\u6613\u3002<\/p>\n

\u5173\u673a\u7cfb\u7edf\u81ea\u52a8\u8fd8\u539f_\u5173\u673a\u7cfb\u7edf\u66f4\u65b0\u600e\u4e48\u53d6\u6d88_linux\u7cfb\u7edf\u5982\u4f55\u5173\u673a<\/p>\n

\u56fe1\uff1a\u6211\u7684\u7cfb\u7edfBIOS\u6709\u4e2a\u6613\u7528\u7684\u5524\u8d77\u5b9a\u65f6\u5668\u3002<\/p>\n

\u4e3b\u673a\u8fdc\u7a0b\u5524\u8d77\uff08Wake-On-LAN\uff09<\/p>\n

\u8fdc\u7a0b\u5524\u8d77\u662f\u4ec5\u6b21\u4e8eBIOS\u5524\u8d77\u7684\u53c8\u4e00\u79cd\u53ef\u9760\u7684\u5524\u8d77\u6280\u5de7\u3002\u8fd9\u987b\u8981\u4f60\u4ece\u7b2c\u4e8c\u53f0\u8ba1\u7b97\u673a\u53d1\u9001\u8baf\u53f7\u5230\u6240\u8981\u6253\u5f00\u7684\u8ba1\u7b97\u673a\u3002\u53ef\u4ee5\u4f7f\u7528Arduino\u6216\u8986\u76c6\u5b50\u6d3eRaspberryPi\u53d1\u9001\u7ed9\u57fa\u4e8eLinux\u7684\u8def\u7531\u5668\u6216\u5219\u4efb\u4f55Linux\u8ba1\u7b97\u673a\u7684\u5524\u8d77\u8baf\u53f7\u3002\u9996\u5148\uff0c\u67e5\u770b\u7cfb\u7edf\u663e\u5361BIOS\u662f\u5426\u652f\u6301Wake-On-LAN\uff0c\u8981\u662f\u652f\u6301\u7684\u8bddlinux\u4e3b\u673a\uff0c\u5fc5\u987b\u5148\u542f\u52a8\u5b83\uff0c\u7531\u4e8e\u5b83\u88ab\u9ed8\u8ba4\u4e3a\u7981\u7528\u3002<\/p>\n

\u4e4b\u540e\uff0c\u987b\u8981\u4e00\u4e2a\u652f\u6301Wake-On-LAN\u7684\u7f51\u5361\uff1b\u65e0\u7ebf\u7f51\u5361\u5e76\u4e0d\u652f\u6301\u3002\u4f60\u987b\u8981\u8fd0\u884cethtool\u547d\u4ee4\u67e5\u770b\u7f51\u5361\u662f\u5426\u652f\u6301Wake-On-LAN\uff1a<\/p>\n

#ethtooleth0|grep-iwake-onSupportsWake-on:pumbgWake-on:g<\/p>\n

\u8fd9\u6761\u547d\u4ee4\u8f93\u51fa\u7684\u201cSupportsWake-on\u201d\u5b57\u6bb5\u4f1a\u544a\u8bc9\u4f60\u4f60\u7684\u7f51\u5361\u73b0\u4eca\u5f00\u542f\u4e86\u4ec0\u4e48\u529f\u80fd\uff1a<\/p>\n

ethtool\u547d\u4ee4\u7684man\u6307\u5357\u5e76\u6ca1\u8bf4\u6e05\u695ap\u9009\u9879\u7684\u4f5c\u7528\uff1b\u8fd9\u8868\u660e\u4efb\u4f55\u8baf\u53f7\u5c31\u4f1a\u9020\u6210\u5524\u8d77\u3002\u4f46\u662f\uff0c\u5728\u6211\u7684\u6d4b\u8bd5\u4e2d\u5b83\u5e76\u6ca1\u6709\u90a3\u4e48\u505a\u3002\u60f3\u8981\u5b9e\u73b0\u8fdc\u7a0b\u5524\u8d77\u4e3b\u673a\uff0c\u5fc5\u987b\u652f\u6301\u7684\u529f\u80fd\u662fg\u2014\u2014\u7279\u5b9a\u6570\u636e\u5305magicpacket\u5524\u8d77\uff0c\u4f46\u662f\u4e0b\u8fb9\u7684\u201cWake-on\u201d\u884c\u663e\u793a\u8fd9\u4e2a\u529f\u80fd\u65e9\u5df2\u5728\u542f\u7528\u4e86\u3002\u5047\u5982\u5b83\u6ca1\u6709\u88ab\u542f\u7528\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7ethtool\u547d\u4ee4\u6765\u542f\u7528\u5b83\u3002<\/p>\n

#ethtool-seth0wolg<\/p>\n

\u8fd9\u6761\u547d\u4ee4\u53ef\u80fd\u4f1a\u5728\u91cd\u542f\u540e\u5931\u6548\uff0c\u6240\u4ee5\u4e3a\u4e86\u786e\u4fdd\u4e07\u65e0\u4e00\u5931\uff0c\u4f60\u53ef\u4ee5\u521b\u5efa\u4e2aroot\u7528\u6237\u7684\u5b9a\u65f6\u4efb\u52a1\uff08cron\uff09\u5728\u6bcf\u6b21\u91cd\u542f\u7684\u65f6\u4faf\u6765\u6267\u884c\u8fd9\u6761\u547d\u4ee4\u3002<\/p>\n

@reboot\/usr\/bin\/ethtool-seth0wolg<\/p>\n

\u53e6\u4e00\u4e2a\u9009\u62e9\u662f\u8fd1\u6765\u7684\u7f51\u8def\u7ba1\u7406\u5668NetworkManager\u7248\u672c\u6709\u4e00\u4e2a\u633a\u597d\u7684\u5c0f\u590d\u9009\u6846\u6765\u542f\u7528Wake-On-LAN\uff08\u56fe2\uff09\u3002<\/p>\n

\u5173\u673a\u7cfb\u7edf\u66f4\u65b0\u600e\u4e48\u53d6\u6d88_linux\u7cfb\u7edf\u5982\u4f55\u5173\u673a_\u5173\u673a\u7cfb\u7edf\u81ea\u52a8\u8fd8\u539f<\/p>\n

\u56fe2\uff1a\u542f\u7528WakeonLAN<\/p>\n

\u8fd9\u513f\u6709\u4e00\u4e2a\u53ef\u4ee5\u7528\u4e8e\u8bbe\u7f6e\u5bc6\u7801\u7684\u5730\u65b9\uff0c\u800c\u4e14\u5047\u5982\u4f60\u7684\u7f51\u8def\u63d2\u53e3\u4e0d\u652f\u6301\u5b89\u5168\u5f00\u673aSecureOn\u5bc6\u7801\uff0c\u5b83\u5c31\u4e0d\u8d77\u4f5c\u7528\u3002<\/p>\n

\u5982\u4eca\u4f60\u987b\u8981\u914d\u7f6e\u7b2c\u4e8c\u53f0\u8ba1\u7b97\u673a\u6765\u53d1\u9001\u5524\u8d77\u8baf\u53f7\u3002\u4f60\u5e76\u4e0d\u987b\u8981root\u6743\u9650linux\u683c\u5f0f\u5316\u786c\u76d8\uff0c\u6240\u4ee5\u4f60\u53ef\u4ee5\u4e3a\u4f60\u7684\u666e\u901a\u7528\u6237\u521b\u5efacron\u4efb\u52a1\u3002\u4f60\u987b\u8981\u7528\u5230\u7684\u662f\u60f3\u8981\u5524\u8d77\u7684\u673a\u5668\u7684\u7f51\u8def\u63d2\u53e3\u548cMAC\u5730\u5740\u4fe1\u606f\u3002<\/p>\n

3008***\/usr\/bin\/wakeonlanD0:50:99:82:E7:2B<\/p>\n

RTC\u5524\u8d77<\/p>\n

\u901a\u8fc7\u4f7f\u7528\u5b9e\u65f6\u95f9\u94c3\u6765\u5524\u8d77\u8ba1\u7b97\u673a\u662f\u6700\u4e0d\u53ef\u9760\u7684\u65b9\u5f0f\u3002\u5bf9\u4e8e\u8fd9\u4e2a\u65b9\u5f0f\uff0c\u53ef\u4ee5\u53c2\u770bWakeUpLinuxWithanRTCAlarmClock[1]\uff1b\u5bf9\u4e8e\u73b0\u4eca\u7684\u5927\u591a\u6570\u53d1\u884c\u7248\u6765\u8bf4\u8fd9\u4e9b\u65b9\u5f0f\u65e9\u5df2\u6709\u70b9\u8fc7\u65f6\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5982\u679c\u4f60\u7684\u7535\u8111\u4e0d\u9700\u8981\u5f00\u673a\u5c31\u8bf7\u628a\u5b83\u4eec\u5173\u673a\u3002\u6709\u4e9b\u4eba\u4e3a\u4ed6\u4eec\u7684\u8ba1\u7b97\u673a\u53ef\u4ee5\u957f\u65f6\u95f4\u7684\u6b63\u5e38\u8fd0\u884c\u800c\u611f\u5230\u81ea\u8c6a\uff0c\u4e14\u73b0\u5728\u6211\u4eec\u6709\u5185\u6838\u70ed\u8865\u4e01\u80fd\u591f\u5b9e\u73b0\u53ea\u6709\u5728\u786c\u4ef6\u53d1\u751f\u6545\u969c\u65f6\u624d\u9700\u8981\u673a\u5668\u5173\u673a\u3002\u5b9a\u65f6\u4efb\u52a1\uff08\u5373\/etc\/crontab\uff09\u53ef\u4ee5\u53ef\u9760\u5730\u5173\u95ed\u7535\u8111\u3002\u5b57\u6bb5\u4f1a\u544a\u8bc9\u4f60\u4f60\u7684\u7f51\u5361\u73b0\u5728\u5f00\u542f\u4e86\u54ea\u4e9b\u529f\u80fd\uff1a<\/p>\n","protected":false},"author":1,"featured_media":288618,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-288617","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/288617","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=288617"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/288617\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/288618"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=288617"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=288617"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=288617"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}