Services can generally be started in 2 ways – on demand, and at bootup. The on demand startup is easy, service nfs start or /etc/init.d/nfs start.
Starting services at bootup is often controlled through the command chkconfig.
Below are several primary commands for using chkconfig, the NFS daemon will be used for the examples
- List services and startup configuration
- chkconfig –list
- Configure service to start on boot
- chkconfig nfs on
- Configure service to start at a specific runlevel
- chkconfig –level 3 nfs on
- Configure service not to start on boot
- chkconfig nfs off
- Add a service to the list of services
- chkconfig –add nfs
- Remove a service from the list of services
- chkconfig –del nfs