Friday, 10 August 2012

chkconfig



                                               
Services can be controlled by three programs in linux.

    chkconfig (command line only)
    ntsysv (simple text-based application that doesn't require a graphical desktop)
    or the Service Configuration Tool (graphical application).

The chkconfig command gives you a simple way to maintain different runlevels within the /etc/rc.d directory structure. With chkconfig, you can add, remove, and change services; list startup information; and check the state of a particular service.

The chkconfig command can be used to configure runlevels and list the current runlevel configuration. It must be run as root if modifying a runlevel. Otherwise commands such as listing whether a service is started at boot time can be run as a non-root user.

Option Description --level runlevel
Specifies a runlevel to turn on, turn off, or reset a service.
--list service
Lists startup information for services at different runlevels. services are just on or off. With no argument, all services are listed.
--add service
Adds a service, creating links in the default specified runlevels (or all runlevels, if none are specified).
--del service
Deletes all links for the service (startup and shutdown) in all runlevel directories.
service on
Turns a service on, creating a service link in the specified or default runlevel directories
service off
Turns a service off, creating shutdown links in specified or default directories.
service reset
Resets service startup information, creating default links as specified in the chkconfig entry in the service's init.d service script.

To check the status of all services on all runlevel use --list switch with |more options
Chkconfig --list | more

To check the status of all services on runlevel one use --list switch with |more options
Chkconfig --list --level  1 | more
To check the status of only vsftpd services on all runlevel one use --list switch with service name
Chkconfig --list vsftpd
To on off vsftpd service on runlevel use on off switch
Chkconfig vsftpd on
Chkconfig vsftpd off
To deleted vsftpd service use del switch ( Note that only service will be delete, not rpm you can add this service again without installing rpm again )
Chkconfig --list  vsftpd
Chkconfig --del  vsftpd
Chkconfig --list  vsftpd
To add service use add switch ( Note rpm must be install first )
Chkconfig --add  vsftpd
Chkconfig --list  vsftpd










No comments:

Post a Comment