Friday, December 16, 2011

HOWTO list all currently running services in RedHat server?

There are different ways and tools to find and list all running services RHEL Linux systems:

service: list running services

service --status-all
service --status-all | grep ntpd
service --status-all | less

Print the status of any service:
For example, apache (httpd) service
service httpd status

List all known services (configured via SysV):
chkconfig --list

List service and their open ports:
netstat -tulpn

Turn on / off a service:
chkconfig service off
chkconfig service on
chkconfig httpd off
chkconfig ntpd on

For more information, please refer to the man page of each command:

service --help
Usage: service < option > | --status-all | [ service_name [ command | --full-restart ] ]

chkconfig --help
chkconfig version - 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 <name>
         chkconfig --del <name>
         chkconfig [--level <levels>] <name> <on|off|reset|resetpriorities>