{"id":9981,"date":"2023-12-17T07:21:38","date_gmt":"2023-12-16T23:21:38","guid":{"rendered":"https:\/\/bohu.net\/blog\/?p=9981"},"modified":"2023-12-28T17:12:40","modified_gmt":"2023-12-28T09:12:40","slug":"%e4%bd%bf%e7%94%a8service-status-all-%e6%88%96-systemctl-status-%e6%9f%a5%e8%af%a2%e6%9c%8d%e5%8a%a1%e7%8a%b6%e6%80%81%e6%97%b6%e5%8d%a1%e9%a1%bf","status":"publish","type":"post","link":"https:\/\/www.bohu.net\/blog\/9981\/","title":{"rendered":"\u4f7f\u7528service &#8211;status-all \u6216 systemctl status \u67e5\u8be2\u670d\u52a1\u72b6\u6001\u65f6\u5361\u987f"},"content":{"rendered":"\n<pre class=\"wp-block-preformatted\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">\u95ee\u9898\uff1a<\/mark><\/strong>\n\n\u5728\u4e00\u4e2a\u8fd0\u884c\u591a\u5e74\u7684 debian \u7cfb\u7edf\u4e2d\uff0c\u4f7f\u7528 <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">service --status-all<\/mark><\/code> \u68c0\u67e5\u670d\u52a1\u5217\u8868\n\u8f93\u51fa\u5230\u9879\u76ee \"<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">[ + ]  cron<\/mark>\" \u65f6\uff0c\u4f1a\u5361\u987f\u5f88\u4e45\uff0c\u624d\u7ee7\u7eed\u663e\u793a\u5176\u4ed6\u670d\u52a1\u540d\u3002<\/pre>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-constrained wp-block-group-is-layout-constrained\">\n<p>\u8d77\u521d\u4e0d\u77e5\u9053\u4e3a\u4ec0\u4e48\u5361\u987f\uff0c\u4eca\u5929\u770b\u5230\u4e00\u6587\uff0c\u4ed6\u5728 systemctl status \u67d0\u670d\u52a1\u540d \u65f6\u5361\u987f\u5f88\u4e45\uff0c\u540e\u6765\u53d1\u73b0\u8fd9\u4e2a\u95ee\u9898\u548csystemd-journald\u6709\u5173\u3002\u6211\u611f\u89c9\u8fd9\u4e2a\u95ee\u9898\u4e5f\u6709\u53ef\u80fd\u4e00\u6837\uff0c\u8001\u7cfb\u7edf\u8fd0\u884c\u591a\u5e74\uff0c\u8bb0\u5f55\u7684\u670d\u52a1\u4fe1\u606f\u8fc7\u591a\u3002\u51b3\u5b9a\u4e5f\u5c1d\u8bd5\u6e05\u7406\u4e00\u4e0bjournald\u3002<\/p>\n\n\n\n<p>\u5355\u72ec\u67e5\u770b<code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-blue-color\">service --status-all<\/mark><\/code> \u4e2d\u5361\u987f\u7684 <code><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">cron<\/mark><\/code><\/p>\n<\/div><\/div>\n\n\n\n<p><code>systemctl status <mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-bright-red-color\">cron<\/mark><\/code><\/p>\n\n\n\n<p>\u679c\u771f\uff0c\u7ffb\u9875\u51e0\u5343\u884c\uff0c\u624d\u53d1\u73b0\u770b\u4e86\u4e0d\u5230\u4e00\u4e2a\u6708\u7684\u8bb0\u5f55\uff0c\u592a\u591a\u4e86<\/p>\n\n\n\n<p><strong>cron<\/strong> \u662f\u5b9a\u65f6\u6267\u884c\u4efb\u52a1\u7684\u670d\u52a1\u3002\u5404\u79cd\u8ba1\u5212\u4efb\u52a1\u7684\u6267\u884c\u90fd\u4f1a\u4ea7\u751f\u5927\u91cf\u7684\u670d\u52a1\u542f\u52a8\u65e5\u5fd7\u3002<\/p>\n\n\n\n<p>\u53ef\u4ee5\u770b\u51fa systemctl  \u8f93\u51fa\u670d\u52a1\u542f\u52a8\u65f6\u7684\u76f8\u5173\u4fe1\u606f\u3002\u90fd\u662f\u4ecesystemd-journald\u4e2d\u8bfb\u53d6\u7684\u3002<\/p>\n\n\n\n<p>\u8fdb\u5165\u6587\u4ef6\u5939 \/var\/log\/journal\uff0c\u91cc\u9762\u6709\u4e00\u4e2a\u957f\u6587\u4ef6\u540d\u7684\u6587\u4ef6\u5939\uff1af25c9fe2e9554b54950734c0b92298e0\uff0c\u91cc\u9762\u662f\u7528\u6237\u7684 system.journal \u6587\u4ef6\uff0c\u8fd8\u6709user-1000.journal\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ls -lhm --full-time \/var\/log\/journal\/f25c9fe2e9554b54950734c0b92298e0\/<\/code><\/pre>\n\n\n\n<p>\u67e5\u770b\u8fd9\u4e2a\u6587\u4ef6\u5939\u4e0b\u6587\u4ef6\u5927\u5c0f\uff0c21,001,486,336 bytes   \u670919.5 GiB\u3002<\/p>\n\n\n\n<p>\u4e0b\u9762\u6e05\u7406 journal  \u6587\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u5148\u505c\u6b62 systemd-journald \u670d\u52a1\n\n<code>systemctl stop systemd-journald<\/code>\n\nWarning: Stopping systemd-journald.service, but it can still be activated by:\n  systemd-journald-dev-log.socket\n  systemd-journald.socket\n  systemd-journald-audit.socket\n\n\u63d0\u793a\u8b66\u544a\uff0c\u4e3a\u4e86\u4fdd\u9669\uff0c\u628a\u8fd9\u51e0\u4e2a\u90fd\u505c\u6b62\u6389\uff1a\n<code>systemctl stop systemd-journald-dev-log.socket\nsystemctl stop systemd-journald.socket<\/code>\n<code>systemctl stop systemd-journald-audit.socket<\/code>\n\n\u7136\u540e\u53ef\u4ee5\u5220\u9664 journal \u6587\u4ef6\uff08\u6211\u76f4\u63a5\u5168\u90e8\u5220\u9664\u4e86\uff0c\u91cd\u8981\u7684\u751f\u4ea7\u670d\u52a1\u5668\u4e0d\u5efa\u8bae\u8fd9\u6837\uff09\n <\/pre>\n\n\n\n<p>\u6700\u540e\u662f\u8981\u9650\u5236systemd-journald\u65e5\u5fd7\u7684\u5927\u5c0f\uff0c\u907f\u514d\u4ee5\u540e\u51fa\u73b0\u8fd9\u4e2a\u95ee\u9898\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">\u7f16\u8f91\u6587\u4ef6\uff1a <code>\/etc\/systemd\/journald.conf<\/code>\n\n\u4fee\u6539\u4ee5\u4e0b\u4e24\u4e2a\u914d\u7f6e\u53c2\u6570\uff1a\n\n<code>SystemMaxUse=100M\nRuntimeMaxUse=100M<\/code>\n\n\u9650\u5236\u5168\u90e8\u65e5\u5fd7\u6587\u4ef6\u52a0\u5728\u4e00\u8d77\u6700\u591a\u53ef\u4ee5\u5360\u7528\u591a\u5c11\u7a7a\u95f4\uff0c\u76f8\u5bf9\u7684\u95ee\u9898\u662f\uff0c\u4ee5\u540e\u7684\u65e5\u5fd7\u8bb0\u5f55\u603b\u91cf\u4e5f\u53d8\u5c11\u4e86\u3002\n\n\u6700\u540e\u91cd\u542f systemd-journald\n\n<code>systemctl restart systemd-journald<\/code>\n<\/pre>\n\n\n\n<p>\u518d\u6b21\u4f7f\u7528 service &#8211;status-all \u6216 systemctl status \u67e5\u8be2\u670d\u52a1\u72b6\u6001\u65f6\uff0c\u5c31\u4e0d\u518d\u51fa\u73b0\u5361\u987f\u4e86\u3002<\/p>\n\n\n\n<p><code>systemctl daemon-reload  #\u91cd\u65b0\u52a0\u8f7d\u670d\u52a1\u914d\u7f6e\u6587\u4ef6<\/code><\/p>\n\n\n\n<p><strong>[end]<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u9898\uff1a \u5728\u4e00\u4e2a\u8fd0\u884c\u591a\u5e74\u7684 debian \u7cfb\u7edf\u4e2d\uff0c\u4f7f\u7528 service &#8211;status-all \u68c0\u67e5\u670d\u52a1\u5217\u8868  &hellip; <a href=\"https:\/\/www.bohu.net\/blog\/9981\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u4f7f\u7528service &#8211;status-all \u6216 systemctl status \u67e5\u8be2\u670d\u52a1\u72b6\u6001\u65f6\u5361\u987f\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6,10,693,27,29],"tags":[741,737,740,735,736,739],"class_list":["post-9981","post","type-post","status-publish","format-standard","hentry","category-linux","category-vps","category-web","category-27","category-29","tag-etc-systemd-journald-conf","tag-cron","tag-journal","tag-service-status-all","tag-systemctl-status","tag-systemd-journald"],"_links":{"self":[{"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/posts\/9981","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/comments?post=9981"}],"version-history":[{"count":3,"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/posts\/9981\/revisions"}],"predecessor-version":[{"id":10009,"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/posts\/9981\/revisions\/10009"}],"wp:attachment":[{"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/media?parent=9981"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/categories?post=9981"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bohu.net\/blog\/wp-json\/wp\/v2\/tags?post=9981"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}