A simple command which help you to set a service in linux to start right after boot. This is extremely necessary for servers which host websites, in case they reboot then all hosting services including apache,pop3,smtp,ftp,dns etc etc, start automatically after boot.
1 2 3 4 5 6 7 8 |
[root@mailserver ~]# chkconfig chkconfig version 1.3.30.2 - Copyright (C) 1997-2000 Red Hat, Inc. This may be freely redistributed under the terms of the GNU Public License. usage: chkconfig --list [name] chkconfig --add chkconfig --del chkconfig [--level ] |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
Options: --level levels The run levels an operation should pertain to. Given as a string of numbers from 0 to 7. For example, --level 35 specifies runlevels 3 and 5. --add name Add a new service for management by chkconfig. When a new service is added, chkconfig ensures that the service has either a start or a kill entry in every runlevel. If any runlevel is missing such an entry, chkconfig creates the appropriate entry as specified by the default values in the init script. Note that default entries in LSB-delimited 'INIT INFO' sections take precedence over the default runlevels in the initscript. --del name Delete the service from chkconfig management, and remove any links in /etc/rc[0-6].d which pertain to it. Note that future package installs for this service may run chkconfig --add, which will re-add such links. To disable a service, run chkconfig name off. --list name List all of the services which chkconfig knows about, and whether they are stopped or started in each runlevel. If name is specified, information is only displayed about service name. |
Lets set our ftp service to start on boot
1 |
[root@mailserver ~]# chkconfig --levels 235 <a title="vsftpd" href="http://www.techat.net/how-to-install-ftp-server-in-linux-centos/">vsftpd</a> on |
Now check chkconfig list to confirm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
[root@mailserver ~]# chkconfig --list crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off gpm 0:off 1:off 2:on 3:off 4:on 5:on 6:off haldaemon 0:off 1:off 2:off 3:off 4:off 5:off 6:off httpd 0:off 1:off 2:off 3:on 4:off 5:off 6:off iptables 0:off 1:off 2:off 3:off 4:off 5:off 6:off kudzu 0:off 1:off 2:off 3:off 4:off 5:off 6:off lm_sensors 0:off 1:off 2:on 3:off 4:on 5:on 6:off lvm2-monitor 0:off 1:on 2:off 3:off 4:off 5:off 6:off mcstrans 0:off 1:off 2:on 3:off 4:on 5:on 6:off messagebus 0:off 1:off 2:off 3:off 4:on 5:on 6:off multipathd 0:off 1:off 2:off 3:off 4:off 5:off 6:off netconsole 0:off 1:off 2:off 3:off 4:off 5:off 6:off netfs 0:off 1:off 2:off 3:off 4:on 5:on 6:off netplugd 0:off 1:off 2:off 3:off 4:off 5:off 6:off network 0:off 1:off 2:on 3:on 4:on 5:on 6:off nscd 0:off 1:off 2:off 3:off 4:off 5:off 6:off portmap 0:off 1:off 2:off 3:off 4:on 5:on 6:off rawdevices 0:off 1:off 2:off 3:off 4:off 5:off 6:off rdisc 0:off 1:off 2:off 3:off 4:off 5:off 6:off restorecond 0:off 1:off 2:on 3:off 4:on 5:on 6:off saslauthd 0:off 1:off 2:off 3:off 4:off 5:off 6:off sendmail 0:off 1:off 2:on 3:on 4:on 5:on 6:off snmpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off snmptrapd 0:off 1:off 2:off 3:off 4:off 5:off 6:off sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off syslog 0:off 1:off 2:on 3:on 4:on 5:on 6:off vsftpd 0:off 1:off 2:on 3:on 4:off 5:on 6:off xinetd 0:off 1:off 2:off 3:off 4:off 5:off 6:off |
Comment Policy:
Your words are your own, so be nice and helpful if you can. Please, only use your real name, not your business name or keywords. Using business name or keywords instead of your real name will lead to the comment being deleted. Anonymous commenting is not allowed either. Limit the amount of links submitted in your comment. We accept clean XHTML in comments, but don't overdo it please.