{"id":133,"date":"2013-10-02T04:56:00","date_gmt":"2013-10-02T04:56:00","guid":{"rendered":"http:\/\/258@jodohost.com\/\/blog\/"},"modified":"2013-10-02T04:56:00","modified_gmt":"2013-10-02T04:56:00","slug":"how-to-make-a-service-stay-on-after-a-reboot","status":"publish","type":"post","link":"http:\/\/www.jodohost.com\/blog\/index.php\/2013\/10\/02\/how-to-make-a-service-stay-on-after-a-reboot\/","title":{"rendered":"How to make a service stay ON after a reboot?"},"content":{"rendered":"<p>Sometimes it happens that a server has been rebooted but we forgot to check if the services which were started before the reboot are still up &#8211; and sometimes this creates issues.<\/p>\n<p>There is a utility in Linux &#8211; &#8216;chkconfig&#8217; &#8211; using which we can turn a service on even after rebooting the Linux server or machine. It is a command-line utility as below :- <\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br \/>chkconfig &#8211;list<\/p>\n<p>The command below will display all the services and the runlevels on which the particular<br \/>service is on or off:- <\/p>\n<p>[root@localhost ~]# chkconfig &#8211;list<\/p>\n<p>httpd\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0:off\u00a0\u00a0 1:off\u00a0\u00a0 2:off\u00a0\u00a0 3:off\u00a0\u00a0 4:off\u00a0\u00a0 5:off\u00a0\u00a0 6:off<br \/>ip6tables\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0:off\u00a0\u00a0 1:off\u00a0\u00a0 2:on\u00a0\u00a0\u00a0 3:on\u00a0\u00a0\u00a0 4:on\u00a0\u00a0\u00a0 5:on\u00a0\u00a0\u00a0 6:off<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<\/p>\n<p>Now to make a particular service stay on after the reboot we need to use the command below:- <\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>[root@localhost ~]# chkconfig httpd on<\/p>\n<p>and then re-check the httpd service status using the command below:- <\/p>\n<p>[root@localhost ~]# chkconfig httpd &#8211;list<\/p>\n<p>httpd\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 0:off\u00a0\u00a0 1:off\u00a0\u00a0 2:on\u00a0\u00a0\u00a0 3:on\u00a0\u00a0\u00a0 4:on\u00a0\u00a0\u00a0 5:on\u00a0\u00a0\u00a0 6:off<br \/>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>That&#8217;s all. Now whether our Linux server\/machine will reboot or not the httpd service will remain started on it.<\/p>\n<p> ]]><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes it happens that a server has been rebooted but we forgot to check if the services which were started before the reboot are still up &#8211; and sometimes this creates issues. There is a utility in Linux &#8211; &#8216;chkconfig&#8217; &#8211; using which we can turn a service on even after rebooting the Linux server [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/133"}],"collection":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=133"}],"version-history":[{"count":0,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/133\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=133"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=133"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.jodohost.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=133"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}