
{"id":1441,"date":"2022-04-08T10:42:36","date_gmt":"2022-04-08T02:42:36","guid":{"rendered":"http:\/\/dba.qishuo.xin\/?p=1441"},"modified":"2023-01-16T10:09:03","modified_gmt":"2023-01-16T02:09:03","slug":"systemd%e6%9c%8d%e5%8a%a1%e6%97%a0%e7%9b%ae%e5%bd%95%e8%ae%bf%e9%97%ae%e6%9d%83%e9%99%90","status":"publish","type":"post","link":"http:\/\/dba.qishuo.xin\/?p=1441","title":{"rendered":"Systemd\u670d\u52a1\u65e0\u76ee\u5f55\u8bbf\u95ee\u6743\u9650\u5bfc\u81f4\u670d\u52a1\u65e0\u6cd5\u542f\u52a8"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_76 ez-toc-wrap-right counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<label for=\"ez-toc-cssicon-toggle-item-6a05475ba08e9\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a05475ba08e9\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"http:\/\/dba.qishuo.xin\/?p=1441\/#1_%E6%95%85%E9%9A%9C%E7%8E%B0%E8%B1%A1%EF%BC%88SYMPTOMS%EF%BC%89\" >1. \u6545\u969c\u73b0\u8c61\uff08SYMPTOMS\uff09<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"http:\/\/dba.qishuo.xin\/?p=1441\/#2_%E5%8F%98%E5%8C%96%EF%BC%88CHANGES%EF%BC%89\" >2. \u53d8\u5316\uff08CHANGES\uff09<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"http:\/\/dba.qishuo.xin\/?p=1441\/#3_%E6%95%85%E9%9A%9C%E5%8E%9F%E5%9B%A0%EF%BC%88CAUSE%EF%BC%89\" >3. \u6545\u969c\u539f\u56e0\uff08CAUSE\uff09<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"http:\/\/dba.qishuo.xin\/?p=1441\/#4_%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%EF%BC%88SOLUTION%EF%BC%89\" >4. \u89e3\u51b3\u65b9\u6848\uff08SOLUTION\uff09<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"http:\/\/dba.qishuo.xin\/?p=1441\/#5_%E6%80%BB%E7%BB%93%EF%BC%88SUMMARY%EF%BC%89\" >5. \u603b\u7ed3\uff08SUMMARY\uff09<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"http:\/\/dba.qishuo.xin\/?p=1441\/#%E9%99%84%E5%BD%95A_%E7%9B%B8%E5%85%B3%E8%81%94%E7%9A%84%E6%96%87%E7%AB%A0\" >\u9644\u5f55A. \u76f8\u5173\u8054\u7684\u6587\u7ae0<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-4'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"http:\/\/dba.qishuo.xin\/?p=1441\/#%E9%99%84%E5%BD%95B_%E5%85%B6%E4%BB%96%E5%8F%82%E8%80%83\" >\u9644\u5f55B. \u5176\u4ed6\u53c2\u8003<\/a><\/li><\/ul><\/nav><\/div>\n<h4><span class=\"ez-toc-section\" id=\"1_%E6%95%85%E9%9A%9C%E7%8E%B0%E8%B1%A1%EF%BC%88SYMPTOMS%EF%BC%89\"><\/span>1. \u6545\u969c\u73b0\u8c61\uff08SYMPTOMS\uff09<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u542f\u52a8mariadb\u670d\u52a1\u65f6\uff0c\u62a5\u5982\u4e0b\u9519\u8bef\uff1a<\/p>\n<pre><code class=\"language-text\">[text]\ncan\u2019t create test file xxxxx.lower-test\nfailed to set environment: access denied\n[system] rejected send message, 2 matched rules; type=\u201dmethod_call\u201d, sender=\u201d:1.203\u2033 (uid=1000 pid=4064 comm=\u201dsystemctl unset-environment<\/code><\/pre>\n<h4><span class=\"ez-toc-section\" id=\"2_%E5%8F%98%E5%8C%96%EF%BC%88CHANGES%EF%BC%89\"><\/span>2. \u53d8\u5316\uff08CHANGES\uff09<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<h4><span class=\"ez-toc-section\" id=\"3_%E6%95%85%E9%9A%9C%E5%8E%9F%E5%9B%A0%EF%BC%88CAUSE%EF%BC%89\"><\/span>3. \u6545\u969c\u539f\u56e0\uff08CAUSE\uff09<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p><span style='color:red'>\u5b89\u88c5 mariadb \u65f6\u5c06\u6570\u636e\u6587\u4ef6\u7684\u4f4d\u7f6e\u653e\u5728\u4e86 \/home \u76ee\u5f55\u4e0b\uff0c\u800c Systemd \u670d\u52a1\u914d\u7f6e\u4e2d\u9ed8\u8ba4\u914d\u7f6e \/home \u76ee\u5f55\u662f\u53d7\u4fdd\u62a4\u7684\uff0c\u4e0d\u5141\u8bb8\u8bfb\u5199\uff0c\u5bfc\u81f4\u670d\u52a1\u65e0\u6cd5\u542f\u52a8\u3002<\/span><\/p>\n<h4><span class=\"ez-toc-section\" id=\"4_%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%EF%BC%88SOLUTION%EF%BC%89\"><\/span>4. \u89e3\u51b3\u65b9\u6848\uff08SOLUTION\uff09<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li>\n<p>a. \u4f18\u5148\u68c0\u67e5\u6587\u4ef6\u7684\u76ee\u5f55\u6743\u9650<\/p>\n<\/li>\n<li>\n<p>b. \u5176\u6b21\u68c0\u67e5\u670d\u52a1\u542f\u52a8\u6587\u4ef6<br \/>\nProtectHome \u53ef\u4ee5\u8bbe\u7f6e\u4e3a <code>true\u3001false\u3001read-only<\/code>\u3002 \u8bbe\u7f6e\u4e3a true \u7684\u65f6\u5019\uff0c<code>\/home<\/code>\u3001 <code>\/root<\/code>\u3001 <code>\/run\/user<\/code> \u5bf9\u5e94\u7528\u4e0d\u53ef\u89c1\u3002\u8bbe\u7f6e\u4e3a read-only, \u4e0a\u8ff0\u4e09\u4e2a\u76ee\u5f55\u5bf9\u5e94\u7528\u53ea\u8bfb\u3002\u8bbe\u7f6e\u4e3a false, \u5219\u5e94\u7528\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee\u8fd9\u4e09\u4e2a\u76ee\u5f55\u3002 \u9ed8\u8ba4\u503c\u662f true\u3002\u4e3a\u4e86\u4fdd\u8bc1\u5e94\u7528\u4e0d\u80fd\u8bbf\u95ee\u7528\u6237\u79c1\u6709\u6570\u636e, \u5efa\u8bae\u6240\u6709\u957f\u65f6\u95f4\u8fd0\u884c\u7684\u670d\u52a1\u5f00\u542f\u8be5\u9009\u9879\u3002<br \/>\nProtectSystem \u53ef\u4ee5\u8bbe\u7f6e\u4e3a true\/false\/full\u3002 \u8bbe\u7f6e\u4e3a true\u65f6\uff0c<code>\/usr<\/code>\u3001<code>\/boot<\/code> \u76ee\u5f55\u88ab\u8bbe\u7f6e\u4e3a\u53ea\u8bfb\u3002 \u8bbe\u7f6e\u4e3a full\u65f6\uff0c<code>\/usr<\/code>\u3001 <code>\/boot<\/code>\u3001 <code>\/etc<\/code> \u76ee\u5f55\u88ab\u8bbe\u7f6e\u4e3a\u53ea\u8bfb\u3002 \u8bbe\u7f6e\u4e3a false\u65f6\uff0c\u5219\u5e94\u7528\u53ef\u4ee5\u6b63\u5e38\u8bbf\u95ee\u4e0a\u8ff0\u76ee\u5f55\u3002\u8fd9\u4e2a\u9009\u9879\u53ef\u4ee5\u4fdd\u62a4\u7cfb\u7edf\u76ee\u5f55\u4e0d\u4f1a\u88ab\u5e94\u7528\u4fee\u6539, \u5efa\u8bae\u6240\u6709\u957f\u65f6\u95f4\u8fd0\u884c\u7684\u670d\u52a1\u5f00\u542f\u8be5\u9009\u9879\u3002<br \/>\n<a href=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/04\/image-1673834935391.png\" data-fancybox=\"images\" data-fancybox=\"images\"><img decoding=\"async\" src=\"http:\/\/dba.qishuo.xin\/wp-content\/uploads\/2022\/04\/image-1673834935391.png\" alt=\"file\" \/><\/a><\/p>\n<\/li>\n<li>\n<p>c. \u6700\u540e\u68c0\u67e5 SELinux<\/p>\n<\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"5_%E6%80%BB%E7%BB%93%EF%BC%88SUMMARY%EF%BC%89\"><\/span>5. \u603b\u7ed3\uff08SUMMARY\uff09<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<p>\u5f53\u524d\u7684\u9700\u6c42\u662f \/home \u76ee\u5f55\u8bbf\u95ee\u6743\u9650\uff0c\u5219\u53ea\u9700\u8981\u4fee\u6539 ProtectHome \u53c2\u6570\u4e3a <code>false<\/code> \u5373\u53ef\u3002\u81f3\u6b64\u91cd\u542f\u670d\u52a1\uff0c\u4e00\u5207\u529f\u80fd\u6b63\u5e38\u3002<\/p>\n<pre><code class=\"language-bash\">[shell]\nsystemctl daemon-reload\nsystemctl restart mariadb<\/code><\/pre>\n<p><strong><span style='color:red'>\u5fc5\u987b\u9996\u5148\u91cd\u65b0\u52a0\u8f7dsystemd\u7684\u914d\u7f6e\uff0c\u5426\u5219\u4e0d\u751f\u6548\u3002<\/span><\/strong><\/p>\n<h4><span class=\"ez-toc-section\" id=\"%E9%99%84%E5%BD%95A_%E7%9B%B8%E5%85%B3%E8%81%94%E7%9A%84%E6%96%87%E7%AB%A0\"><\/span>\u9644\u5f55A. \u76f8\u5173\u8054\u7684\u6587\u7ae0<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li><a target=\"_blank\" href=\"http:\/\/dba.qishuo.xin\/?p=2633\" title=\"Linux\u4e0b\u4f7f\u7528rinetd\u914d\u7f6e\u7aef\u53e3\u8f6c\u53d1\">Linux\u4e0b\u4f7f\u7528rinetd\u914d\u7f6e\u7aef\u53e3\u8f6c\u53d1<\/a><\/li>\n<\/ul>\n<h4><span class=\"ez-toc-section\" id=\"%E9%99%84%E5%BD%95B_%E5%85%B6%E4%BB%96%E5%8F%82%E8%80%83\"><\/span>\u9644\u5f55B. \u5176\u4ed6\u53c2\u8003<span class=\"ez-toc-section-end\"><\/span><\/h4>\n<ul>\n<li><a target=\"_blank\" href=\"https:\/\/blog.csdn.net\/stone_fall\/article\/details\/108630115\" title=\"system.service\u53c2\u6570\u89e3\u6790\">system.service\u53c2\u6570\u89e3\u6790<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>1. \u6545\u969c\u73b0\u8c61\uff08SYMPTOMS\uff09 \u542f\u52a8maria&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[47],"tags":[48,196],"class_list":["post-1441","post","type-post","status-publish","format-standard","hentry","category-linux","tag-linux","tag-systemd"],"_links":{"self":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/1441","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1441"}],"version-history":[{"count":10,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/1441\/revisions"}],"predecessor-version":[{"id":2666,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=\/wp\/v2\/posts\/1441\/revisions\/2666"}],"wp:attachment":[{"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1441"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1441"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/dba.qishuo.xin\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1441"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}