chkconfig – starting a service on boot in linux | MyLiteratureTechLife.COM

chkconfig – starting a service on boot in linux

October 3rd, 2010 0 Comments






















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.

[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 ]
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

[root@mailserver ~]# chkconfig --levels 235 <a title="vsftpd" href="http://www.myliteraturetechlife.com/how-to-install-ftp-server-in-linux-centos/">vsftpd</a> on

Now check chkconfig list to confirm

[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

Related posts:

  1. Managing services with update-rc.d
  2. How to install ftp server in Linux – CentOS
  3. Error starting Apache in XAMPP
  4. How to transfer a Linux image from VirtualBox to Xen
 

If You Like This Post, Share it With Your Friends & Peers

Digg
stumbleupon
Delicious
facebook
twitter
reddit
rss feed bookmar
 

No Comment to “chkconfig – starting a service on boot in linux”

  1. No Comment yet. Be the first to comment...

Leave your comment here:

*

Alexa Rank