{"id":277,"date":"2018-06-04T09:27:08","date_gmt":"2018-06-04T01:27:08","guid":{"rendered":"https:\/\/jpeng.xyz\/?p=277"},"modified":"2018-12-01T21:22:43","modified_gmt":"2018-12-01T13:22:43","slug":"red-hat-centos%ef%bc%9a%e6%a3%80%e6%9f%a5-%e5%88%97%e5%87%ba%e6%ad%a3%e5%9c%a8%e8%bf%90%e8%a1%8c%e7%9a%84%e6%9c%8d%e5%8a%a1","status":"publish","type":"post","link":"https:\/\/jpeng.xyz\/?p=277","title":{"rendered":"Red Hat \/ CentOS\uff1a\u68c0\u67e5\/\u5217\u51fa\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1"},"content":{"rendered":"<p>\u6709\u591a\u79cd\u65b9\u5f0f\u548c\u5de5\u5177\u53ef\u4ee5\u5728Fedora \/ RHEL \/ CentOS Linux\u7cfb\u7edf\u4e0b\u67e5\u627e\u5e76\u5217\u51fa\u6240\u6709\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u3002<\/p>\n<h3>\u670d\u52a1\u547d\u4ee4\u5217\u8868\u8fd0\u884c\u670d\u52a1<\/h3>\n<blockquote><p>\n  CentOS \/ RHEL 6.x\u53ca\u66f4\u65e9\u7248\u672c\uff08\u9884\u7cfb\u7edf\uff09\u7684\u8bed\u6cd5\u5982\u4e0b\uff1a\n<\/p><\/blockquote>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-null\">service --status-all\nservice --status-all | more\nservice --status-all | grep ntpd\nservice --status-all | less\n<\/code><\/pre>\n<h3>\u6253\u5370\u4efb\u4f55\u670d\u52a1\u7684\u72b6\u6001<\/h3>\n<blockquote><p>\n  \u8981\u6253\u5370apache\uff08httpd\uff09\u670d\u52a1\u7684\u72b6\u6001\uff1a\n<\/p><\/blockquote>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-null\">service httpd status\n<\/code><\/pre>\n<h3>\u5217\u51fa\u6240\u6709\u5df2\u77e5\u670d\u52a1\uff08\u901a\u8fc7SysV\u914d\u7f6e\uff09<\/h3>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-null\">chkconfig --list\n<\/code><\/pre>\n<h3>\u5217\u51fa\u670d\u52a1\u53ca\u5176\u5f00\u653e\u7aef\u53e3<\/h3>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-null\">netstat -tulpn\n<\/code><\/pre>\n<h3>\u6253\u5f00\/\u5173\u95ed\u670d\u52a1<\/h3>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-null\">ntsysv\nchkconfig service off\nchkconfig service on\nchkconfig httpd off\nchkconfig ntpd on\n<\/code><\/pre>\n<p>ntsysv\u662f\u7528\u4e8e\u914d\u7f6e\u8fd0\u884c\u7ea7\u522b\u670d\u52a1\u7684\u7b80\u5355\u754c\u9762\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7chkconfig\u8fdb\u884c\u914d\u7f6e\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u5b83\u914d\u7f6e\u5f53\u524d\u7684\u8fd0\u884c\u7ea7\u522b\u3002\u53ea\u9700\u952e\u5165ntsysv\u5e76\u9009\u62e9\u60a8\u60f3\u8981\u8fd0\u884c\u7684\u670d\u52a1\u3002<\/p>\n<h3>\u6709\u5173systemd\u7684RHEL \/ CentOS 7.x\u7684\u6ce8\u610f\u4e8b\u9879<\/h3>\n<p>\u5982\u679c\u60a8\u4f7f\u7528\u7684\u662f\u57fa\u4e8esystemd\u7684\u53d1\u884c\u7248\uff0c\u4f8b\u5982Fedora Linux v22 \/ 23\/24\u6216RHEL \/ CentOS Linux 7.x +\u3002\u5c1d\u8bd5\u4f7f\u7528systemctl\u547d\u4ee4\u5217\u51fa\u6b63\u5728\u8fd0\u884c\u7684\u670d\u52a1\u7684\u4ee5\u4e0b\u547d\u4ee4\u3002\u5b83\u63a7\u5236\u7740systemd\u7cfb\u7edf\u548c\u670d\u52a1\u7ba1\u7406\u5668\u3002<\/p>\n<h3>\u5728CentOS \/ RHEL 7.x +\u4e0a\u4f7f\u7528\u5217\u51fasystemd\u670d\u52a1<\/h3>\n<blockquote><p>\n  \u8bed\u6cd5\u662f\uff1a\u5217\u51fa\u6240\u6709\u670d\u52a1\uff1a\u793a\u4f8b\u8f93\u51fa\uff1a\n<\/p><\/blockquote>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-null\">systemctl\nsystemctl | more\nsystemctl | grep httpd\nsystemctl list-units --type service\nsystemctl list-units --type mount\n<\/code><\/pre>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-null\">systemctl list-unit-files\n<\/code><\/pre>\n<p><img decoding=\"async\" src=\"https:\/\/jpeng.xyz\/wp-content\/uploads\/2018\/06\/27d4d7fcde403aa1f31bac947aa724e3.png\" alt=\"\" \/><br \/>\n\u56fe01\uff1a\u5217\u51faCentOS \/ RHEL 7 systemd\u7cfb\u7edf\u4e0a\u5b89\u88c5\u7684\u6240\u6709\u8bbe\u5907\u53ca\u5176\u5f53\u524d\u72b6\u6001<\/p>\n<p>\u8981\u67e5\u770b\u4e0e\u7279\u5b9a\u670d\u52a1\uff08cgroup\uff09\u5173\u8054\u7684\u8fdb\u7a0b\uff0c\u53ef\u4ee5\u4f7f\u7528systemd-cgtop\u547d\u4ee4\u3002\u4e0etop\u547d\u4ee4\u4e00\u6837\uff0csystemd-cgtop\u57fa\u4e8e\u5176\u670d\u52a1\u5217\u51fa\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b\uff1a<\/p>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-null\">systemd-cgtop\n<\/code><\/pre>\n<p>\u793a\u4f8b\u8f93\u51fa\uff1a<\/p>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-null\">\u8def\u5f84\u4efb\u52a1\uff05CPU\u5185\u5b58\u8f93\u5165\/\u79d2\u8f93\u51fa\/\u79d2\n\n\/ 85 0.3 240.1M  -   - \n\/system.slice\/NetworkManager.service 2  -   -   -   - \n\/system.slice\/auditd.service 1  -   -   -   - \n\/system.slice\/crond.service 1  -   -   -   - \n\/system.slice\/dbus.service 1  -   -   -   - \n\/system.slice\/lvm2-lvmetad.service 1  -   -   -   - \n\/system.slice\/polkit.service 1  -   -   -   - \n\/system.slice\/postfix.service 3  -   -   -   - \n\/system.slice\/rsyslog.service 1  -   -   -   - \n\/system.slice\/sshd.service 1  -   -   -   - \n\/system.slice\/...tty.slice\/getty@tty1.service 1  -   -   -   - \n\/system.slice\/systemd-journald.service 1  -   -   -   - \n\/system.slice\/systemd-logind.service 1  -   -   -   - \n\/system.slice\/systemd-udevd.service 1  -   -   -   - \n\/system.slice\/tuned.service 1  -   -   -   - \n\/system.slice\/wpa_supplicant.service 1  -   -   -   - \n\/user.slice\/user-0.slice\/session-2.scope 1  -   -   -   - \n\/user.slice\/user-1000.slice\/session-1.scope 4  -   -   -   - \n<\/code><\/pre>\n<h3>\u4ec5\u5728CentOS \/ RHEL 7.x +\u4f7f\u7528\u4e2d\u5217\u51faSysV\u670d\u52a1\uff08\u4e0d\u5305\u62ec\u672c\u5730systemd\u670d\u52a1\uff09<\/h3>\n<pre class=\"line-numbers prism-highlight\" data-start=\"1\"><code class=\"language-null\">chkconfig --list\n<\/code><\/pre>\n<p>\u793a\u4f8b\u8f93\u51fa\uff1a<br \/>\n<img decoding=\"async\" src=\"https:\/\/jpeng.xyz\/wp-content\/uploads\/2018\/06\/f8b6390f07a9cf4759504b5eba070bc2.png\" alt=\"\" \/><br \/>\n\u56fe02\uff1a\u5728systemd\u4e0a\u5217\u51fa\u57fa\u4e8eSysv\u7684\u670d\u52a1<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u591a\u79cd\u65b9\u5f0f\u548c\u5de5\u5177\u53ef\u4ee5\u5728Fedora \/ RHEL \/ Cen&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-277","post","type-post","status-publish","format-standard","hentry","category-2"],"_links":{"self":[{"href":"https:\/\/jpeng.xyz\/index.php?rest_route=\/wp\/v2\/posts\/277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jpeng.xyz\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jpeng.xyz\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jpeng.xyz\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jpeng.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=277"}],"version-history":[{"count":1,"href":"https:\/\/jpeng.xyz\/index.php?rest_route=\/wp\/v2\/posts\/277\/revisions"}],"predecessor-version":[{"id":278,"href":"https:\/\/jpeng.xyz\/index.php?rest_route=\/wp\/v2\/posts\/277\/revisions\/278"}],"wp:attachment":[{"href":"https:\/\/jpeng.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jpeng.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jpeng.xyz\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}