{"id":565,"date":"2020-06-12T11:53:23","date_gmt":"2020-06-12T03:53:23","guid":{"rendered":"http:\/\/www.kiccleaf.com\/?p=565"},"modified":"2020-08-25T12:22:54","modified_gmt":"2020-08-25T04:22:54","slug":"linux%e4%b8%ad%e7%9a%84chkconfig%e5%a2%9e%e5%8a%a0%e8%87%aa%e5%b7%b1%e6%83%b3%e8%a6%81%e5%90%af%e5%8a%a8%e9%a1%b9","status":"publish","type":"post","link":"http:\/\/www.kiccleaf.com\/?p=565","title":{"rendered":"Linux\u4e2d\u7684chkconfig\u589e\u52a0\u81ea\u5df1\u60f3\u8981\u542f\u52a8\u9879"},"content":{"rendered":"<p>\u603b\u6709\u4e9b\u9700\u8981\u81ea\u5df1\u914d\u7f6e\u542f\u52a8\u9879\u7684\uff0c\u7b80\u5355\u8bb0\u5f55\u4e00\u4e0b\u8fc7\u7a0b<\/p>\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#\u5148\u5199\u4e00\u4e2a\u81ea\u5df1\u9700\u8981\u6267\u884c\u7684\u8f6f\u4ef6\u6216\u662f\u5176\u4ed6\u8981\u6267\u884c\u7684\u4e8b\u9879\uff0c\u8fd9\u91cc\u5c31\u62ff\u540c\u6b65\u7cfb\u7edf\u65f6\u95f4\u4f5c\u4e3a\u4f8b\u5b50\n&#x5B;root@localhost ~]# vim \/root\/syncDate.sh\n#!\/bin\/bash\n\/usr\/sbin\/ntpdate cn.pool.ntp.org&gt;\/root\/times.log\n&#x5B;root@localhost ~]# chmod +x \/root\/syncDate.sh\n\n#\u5f00\u59cb\u5199\u542f\u52a8\u9879\u6587\u4ef6kiccleaf\n&#x5B;root@localhost ~]# vim \/etc\/init.d\/kiccleaf\n#!\/bin\/bash\n# chkconfig: 3 88 88\n\/bin\/bash \/root\/syncDate.sh &amp;&gt;\/dev\/null 2&amp;&gt;\/dev\/null\n\n<\/pre>\n<p>\u6ce8\u610f\uff1a# chkconfig: 3 88 88 \u8fd9\u4e00\u884c\u5f88\u91cd\u8981\uff0c\u5982\u679c\u4e0d\u6dfb\u52a0\uff0c<br \/>\n\u6267\u884cchkconfig &#8211;add kiccleaf \u4f1a\u63d0\u793a\u5931\u8d25<\/p>\n<pre><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n&#x5B;root@localhost ~]# chkconfig --add kiccleaf\nservice kiccleaf does not support chkconfig\n#\u4ee5\u4e0a\u662f\u5931\u8d25\u63d0\u9192\uff0c\u672a\u589e\u52a0# chkconfig: 3 88 88\n\n#\u589e\u52a0\u53ef\u6267\u884c\u6743\u9650\n&#x5B;root@localhost ~]# chmod +x \/etc\/init.d\/kiccleaf\n\n#\u6dfb\u52a0\u5230chkconfig\uff0c\u5f00\u673a\u81ea\u542f\u52a8\n&#x5B;root@localhost ~]# chkconfig --add kiccleaf\n&#x5B;root@localhost ~]# chkconfig --list kiccleaf\n\nNote: This output shows SysV services only and does not include native\n      systemd services. SysV configuration data might be overridden by native\n      systemd configuration.\n\n      If you want to list systemd services use 'systemctl list-unit-files'.\n      To see services enabled on particular target use\n      'systemctl list-dependencies &#x5B;target]'.\n\nkiccleaf        0:off   1:off   2:off   3:on    4:off   5:off   6:off\n#\u91cd\u542f\u7cfb\u7edf\uff0c\u67e5\u770b\u7ed3\u679c\n\n&#x5B;root@localhost ~]# cat \/root\/times.log\n12 Jun 11:38:34 ntpdate&#x5B;10221]: step time server 203.107.6.88 offset -28799.359688 sec\n\u64cd\u4f5c\u6210\u529f\n\n#\u5173\u95ed\u5f00\u673a\u542f\u52a8\n\n&#x5B;root@localhost ~]# chkconfig kiccleaf off\n&#x5B;root@localhost ~]# chkconfig --list kiccleaf\nkiccleaf        0:off   1:off   2:off   3:off   4:off   5:off   6:off\n\n#\u4ecechkconfig\u7ba1\u7406\u4e2d\u5220\u9664kiccleaf\n&#x5B;root@localhost ~]# chkconfig --del kiccleaf\n#\u67e5\u770b\u5217\u8868\u4e2d\u662f\u5426\u8fd8\u5b58\u5728kiccleaf\u542f\u52a8\u9879\uff0c\u7ed3\u679c\u5df2\u7ecf\u6ca1\u6709\n&#x5B;root@localhost ~]# chkconfig --list kiccleaf\nservice kiccleaf supports chkconfig, but is not referenced in any runlevel (run 'chkconfig --add kiccleaf')\n\n<\/pre>\n<p>\u5173\u4e8echkconfig\u66f4\u591a\u5185\u5bb9\uff0c\u53ef\u4ee5\u53c2\u8003\uff1a<a href=\"http:\/\/www.kiccleaf.com\/?p=503\">Linux\u4e0bchkconfig\u547d\u4ee4\u8be6\u89e3<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u603b\u6709\u4e9b\u9700\u8981\u81ea\u5df1\u914d\u7f6e\u542f\u52a8\u9879\u7684\uff0c\u7b80\u5355\u8bb0\u5f55\u4e00\u4e0b\u8fc7\u7a0b #\u5148&#8230;<\/p>\n<div class=\"more-link-wrapper\"><a class=\"more-link\" href=\"http:\/\/www.kiccleaf.com\/?p=565\">Continue reading<span class=\"screen-reader-text\">Linux\u4e2d\u7684chkconfig\u589e\u52a0\u81ea\u5df1\u60f3\u8981\u542f\u52a8\u9879<\/span><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":3,"footnotes":""},"categories":[4],"tags":[13],"class_list":["post-565","post","type-post","status-publish","format-standard","hentry","category-linux-","tag-linux","entry"],"views":1837,"_links":{"self":[{"href":"http:\/\/www.kiccleaf.com\/index.php?rest_route=\/wp\/v2\/posts\/565","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.kiccleaf.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.kiccleaf.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.kiccleaf.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.kiccleaf.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=565"}],"version-history":[{"count":4,"href":"http:\/\/www.kiccleaf.com\/index.php?rest_route=\/wp\/v2\/posts\/565\/revisions"}],"predecessor-version":[{"id":617,"href":"http:\/\/www.kiccleaf.com\/index.php?rest_route=\/wp\/v2\/posts\/565\/revisions\/617"}],"wp:attachment":[{"href":"http:\/\/www.kiccleaf.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=565"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.kiccleaf.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=565"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.kiccleaf.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=565"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}