• 1-888-289-2246
  • 24x7x365 Presence

How to make a service stay ON after a reboot?


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 – and sometimes this creates issues.

There is a utility in Linux – ‘chkconfig’ – using which we can turn a service on even after rebooting the Linux server or machine. It is a command-line utility as below :-

——————————————————————————————
chkconfig –list

The command below will display all the services and the runlevels on which the particular
service is on or off:-

[root@localhost ~]# chkconfig –list

httpd           0:off   1:off   2:off   3:off   4:off   5:off   6:off
ip6tables       0:off   1:off   2:on    3:on    4:on    5:on    6:off
—————————————————————————————————————————–

Now to make a particular service stay on after the reboot we need to use the command below:-

———————————————————————————————–
[root@localhost ~]# chkconfig httpd on

and then re-check the httpd service status using the command below:-

[root@localhost ~]# chkconfig httpd –list

httpd           0:off   1:off   2:on    3:on    4:on    5:on    6:off
————————————————————————————————-

That’s all. Now whether our Linux server/machine will reboot or not the httpd service will remain started on it.

]]>


Leave a Reply

Your email address will not be published. Required fields are marked *