Wednesday, December 1, 2010

Starting and Stopping Services

1. To start http service :
# /etc/rc.d/init.d/httpd start
# service sshd start

2. To stop http service :
# /etc/rc.d/init.d/httpd stop
# service sshd stop

3. To restartp http service :
# /etc/rc.d/init.d/httpd restart
# service sshd restart

4. To show the status of http service :
# /etc/rc.d/init.d/httpd status
# service sshd status

5. To show the status of all the services :
# service --status-all

6. To list the state of a service in different run levels :
# chkconfig --list ypxfrd

7. To list the state of all the services in different run levels :
# chkconfig --list

8. To enable SSH service in run levels 2,3 and 4 :
# chkconfig --level 234 sshd on

9. To disable SSH service in run levels 2,3 and 4 :
# chkconfig --level 234 sshd off

No comments: