{"id":266,"date":"2016-06-16T11:07:08","date_gmt":"2016-06-16T03:07:08","guid":{"rendered":"http:\/\/www.5x44.cn\/?p=266"},"modified":"2019-02-27T10:17:25","modified_gmt":"2019-02-27T02:17:25","slug":"systemd-how-to","status":"publish","type":"post","link":"https:\/\/www.5x44.cn\/?p=266","title":{"rendered":"Systemd how to"},"content":{"rendered":"<blockquote class=\"wp-embedded-content\" data-secret=\"Z3qKg71vee\"><p><a href=\"https:\/\/www.certdepot.net\/rhel7-get-started-systemd\/\">RHEL7: How to get started with Systemd.<\/a><\/p><\/blockquote>\n<p><iframe loading=\"lazy\" class=\"wp-embedded-content\" sandbox=\"allow-scripts\" security=\"restricted\" style=\"position: absolute; visibility: hidden;\" title=\"&#8220;RHEL7: How to get started with Systemd.&#8221; &#8212; CertDepot\" src=\"https:\/\/www.certdepot.net\/rhel7-get-started-systemd\/embed\/#?secret=Yjr5lIoPzP#?secret=Z3qKg71vee\" data-secret=\"Z3qKg71vee\" width=\"600\" height=\"338\" frameborder=\"0\" marginwidth=\"0\" marginheight=\"0\" scrolling=\"no\"><\/iframe><\/p>\n<p>http:\/\/lxiaogao.lofter.com\/post\/1cc6a101_62292d3<\/p>\n<h1>\u7406\u89e3SYSTEM UNITS<\/h1>\n<p>Units\u8ba9systemd\u77e5\u9053\u5982\u4f55\u7ba1\u7406\u5bf9\u8c61\u3002\u8fd9\u91cc\u6709\u4e00\u4e9b\u5bf9\u88ab\u7ba1\u7406\u7684\u7cfb\u7edf\u8d44\u6e90\u57fa\u672c\u5730\u6807\u51c6\u5316\u63cf\u8ff0\u3002\u4e00\u4e9b\u529f\u80fdunits\u80fd\u7b80\u5355\u7684\u5b9e\u73b0\uff1a<\/p>\n<ul>\n<li><strong>\u57fa\u4e8e\u5957\u63a5\u5b57\u7684\u6fc0\u6d3b<\/strong>\uff1a\u5957\u63a5\u5b57\u548c\u670d\u52a1\u7684\u8054\u7cfb\u5f88\u597d\u7684\u7a81\u7834\u4e86daemon\u5b83\u81ea\u5df1\u7684\u5904\u7406\u987a\u5e8f\u3002\u8fd9\u6709\u5f88\u591a\u7684\u4f18\u70b9\uff0c\u5982\uff1a\u5ef6\u8fdf\u4e86\u670d\u52a1\u7684\u542f\u52a8\uff0c\u76f4\u5230\u5173\u8054\u7684\u5957\u63a5\u5b57\u5148\u88ab\u8bbf\u95ee\u3002\u8fd9\u540c\u6837\u5141\u8bb8\u7cfb\u7edf\u5728\u542f\u52a8\u9636\u6bb5\u5efa\u7acb\u6240\u6709\u5957\u63a5\u5b57\uff0c\u4f7f\u6240\u6709\u76f8\u5173\u7684\u670d\u52a1\u5e76\u884c\u542f\u52a8\u3002<\/li>\n<li><strong>\u57fa\u4e8e\u603b\u7ebf\u7684\u6fc0\u6d3b\uff1a<\/strong>Units\u4e5f\u80fd\u88abD-Bus\u63d0\u4f9b\u7684\u603b\u7ebf\u63a5\u53e3\u6fc0\u6d3b\u3002\u4e00\u4e2aunit\u53ef\u4ee5\u88ab\u4e0e\u5176\u76f8\u5173\u7684\u603b\u7ebf\u6fc0\u6d3b\u3002<\/li>\n<li><strong>\u57fa\u4e8e\u8def\u5f84\u7684\u6fc0\u6d3b\uff1a<\/strong>unit\u53ef\u4ee5\u88ab\u67d0\u4e2a\u53ef\u7528\u7684\u6216\u6b63\u5728\u4f7f\u7528\u7684\u6587\u4ef6\u7cfb\u7edf\u76ee\u5f55\u6fc0\u6d3b\u3002<\/li>\n<li><strong>\u9690\u542b\u4f9d\u8d56\u6620\u5c04\uff1a<\/strong>systemd\u81ea\u5df1\u53ef\u4ee5\u4e3a\u591a\u6570unit\u5efa\u7acb\u4f9d\u8d56\u6811\u3002\u4e5f\u53ef\u4ee5\u81ea\u5df1\u624b\u52a8\u6dfb\u52a0\uff0c\u4f46\u5bf9\u4e8e\u91cd\u8981\u7684\u670d\u52a1\u8981\u975e\u5e38\u7684\u614e\u91cd\u3002<\/li>\n<li><strong>\u5b9e\u4f8b\u548c\u6a21\u677f\uff1a<\/strong>\u6a21\u7248unit\u6587\u4ef6\u80fd\u7528\u6765\u5efa\u7acb\u591a\u4e2a\u76f8\u4f3c\u7684unit\u5b9e\u4f8b\u3002\u8fd9\u7528\u4e8e\u6709\u5c11\u8bb8\u6539\u53d8\u6216\u540c\u7ea7\u7684unit\uff0c\u5b83\u4eec\u63d0\u4f9b\u76f8\u540c\u7684\u529f\u80fd\u3002<\/li>\n<li><strong>\u7b80\u5355\u3001\u5b89\u5168\uff1a<\/strong>\u53ef\u80fd\u901a\u8fc7\u4e00\u4e9b\u6307\u4ee4\u8ba9unit\u5b9e\u73b0\u76f8\u5f53\u597d\u7684\u5b89\u5168\u529f\u80fd\u3002\u4f8b\u5982\uff1a\u53ef\u4ee5\u6307\u5b9a\u6ca1\u6709\u8bbf\u95ee\u6743\u9650\u6216\u53ea\u8bfb\u8bbf\u95ee\u6587\u4ef6\u7cfb\u7edf\u7684\u4e00\u90e8\u5206\uff0c\u9650\u5236\u5185\u6838\u80fd\u529b\uff0c\u5e76\u4e14\u53ef\u4ee5\u5206\u914d\u79c1\u6709\/tmp\u548c\u7f51\u7edc\u8bbf\u95ee\u3002<\/li>\n<li><strong>drop-ins and snippets\uff1a<\/strong>Unit\u80fd\u88ab\u7b80\u5355\u7684\u6269\u5c55\uff0c\u53ea\u8981\u63d0\u4f9b\u8986\u76d6\u7684\u90e8\u5206\u5c31\u53ef\u4ee5\u3002<\/li>\n<\/ul>\n<h1>Systemd Unit\u6587\u4ef6\u5728\u54ea\u91cc\uff1f<\/h1>\n<p>unit\u6587\u4ef6\u53ef\u4ee5\u5728\u5f88\u591a\u4e0d\u540c\u7684\u4f4d\u7f6e\uff0c\u5b83\u4eec\u6709\u4e0d\u540c\u7684\u5c5e\u6027\u548c\u542b\u610f\u3002\u5f53\u8f6f\u4ef6\u5b89\u88c5\u4e4b\u540e\uff0cunit\u9ed8\u8ba4\u7684\u5b58\u653e\u4f4d\u7f6e\u5728\/lib\/systemd\/system\u76ee\u5f55\u3002<\/p>\n<p>unit\u6587\u4ef6\u88ab\u5b58\u653e\u5728\u8fd9\u91cc\uff0c\u53ef\u4ee5\u5728\u4e00\u4e2a\u4f1a\u8bdd\u4e2d\u88ab\u4ee5deman\u7684\u5f62\u5f0f\u5f00\u59cb\u548c\u505c\u6b62\u3002<\/p>\n<table class=\"lt-4-cols lt-7-rows\" summary=\"Systemd Unit Files Locations\">\n<thead>\n<tr>\n<th id=\"idm140058815227872\" scope=\"col\">\u76ee\u5f55<\/th>\n<th id=\"idm140058815227392\" scope=\"col\">\u63cf\u8ff0<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td headers=\"idm140058815227872\"><code class=\"filename\">\/usr\/lib\/systemd\/system\/<\/code><\/td>\n<td headers=\"idm140058815227392\">RPM\u5305\u5b89\u88c5\u7684\u670d\u52a1\u5355\u5143\u3002<\/td>\n<\/tr>\n<tr>\n<td headers=\"idm140058815227872\"><code class=\"filename\">\/run\/systemd\/system\/<\/code><\/td>\n<td headers=\"idm140058815227392\">\u5728\u8fd0\u884c\u65f6\u521b\u5efa\u7684systemd unit\u6587\u4ef6\u3002 \u8be5\u76ee\u5f55\u7684\u4f18\u5148\u7ea7\u9ad8\u4e8e\u5b89\u88c5\u7684\u670d\u52a1\u5355\u5143\u3002<\/td>\n<\/tr>\n<tr>\n<td headers=\"idm140058815227872\"><code class=\"filename\">\/etc\/systemd\/system\/<\/code><\/td>\n<td headers=\"idm140058815227392\">\u8be5\u76ee\u5f55\u7684Sysstemd unit\u7531<code class=\"command\">systemctl enable<\/code>\u521b\u5efa\uff0c\u540c\u65f6\u8be5unit\u6587\u4ef6\u7528\u4e8e\u6269\u5c55\u670d\u52a1 \u3002\u8fd9\u4e2a\u76ee\u5f55\u7684\u4f18\u5148\u7ea7\u9ad8\u4e8e\u8fd0\u884c\u65f6\u523b\u7684\u5355\u5143\u6587\u4ef6\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\/etc\/systemd\/system\u76ee\u5f55\u7528\u4e8e\u7cfb\u7edf\u7ba1\u7406\u5458\u81ea\u5b9a\u4e49\u521b\u5efa\u5355\u5143\u6587\u4ef6\u3002<\/p>\n<p>\u5355\u5143\u6587\u4ef6\u540d\u7684\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n<pre class=\"synopsis\"><em class=\"replaceable\">unit_name<\/em>.<em class=\"replaceable\">type_extension<\/em><\/pre>\n<div class=\"para\">unit_name\uff1aunit\u6587\u4ef6\u540d\u3002<\/div>\n<div>type_extension\uff1a\u8868\u793aunit\u7c7b\u578b\u3002<\/div>\n<p>https:\/\/access.redhat.com\/documentation\/en-us\/red_hat_enterprise_linux\/7\/html\/system_administrators_guide\/sect-managing_services_with_systemd-unit_files<\/p>\n","protected":false},"excerpt":{"rendered":"<p>RHEL7: How to get started with Systemd. http:\/\/lxiaogao.lofter.com\/post\/1cc6a101&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.5x44.cn\/?p=266\"> Read More<span class=\"screen-reader-text\">  Read More<\/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":[8],"tags":[17],"class_list":["post-266","post","type-post","status-publish","format-standard","hentry","category-it","tag-linux"],"_links":{"self":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts\/266","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=266"}],"version-history":[{"count":11,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts\/266\/revisions"}],"predecessor-version":[{"id":6104,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=\/wp\/v2\/posts\/266\/revisions\/6104"}],"wp:attachment":[{"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=266"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=266"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.5x44.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=266"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}