Tuesday 11 June 2013

Check If A Service Is Running Or Not


How do I find out if a service such as MySQL or Apache running on my Centos/RHEL/Fedora Linux Server?

# Service servername status

# service named status

# Service mysqld status


Find out status of all services

The service --status-all command runs all init scripts, in alphabetical order, with the status command:
 
# Service --status-all


Sample outputs:

acpid (pid 2915) is running...
anacron (pid  3198) is running...
atd (pid  3211) is running...
auditd (pid  2637) is running...
automount (pid 3011) is running...
Avahi daemon is running
Avahi DNS daemon is not running
hcid (pid 2830) is running...
sdpd (pid 2836) is running...
capi not installed - No such file or directory (2)
conmand is stopped
cpuspeed is stopped
crond (pid  3150) is running...
cupsd (pid  3070) is running...
cups-config-daemon is obsolete
dnsdomainname: Unknown host
dnsmasq is stopped
dund is stopped
Usage: /etc/init.d/firstboot {start|stop}
gpm (pid  3136) is running...
hald (pid 2934) is running...
hidd (pid 2986) is running...
hpiod (pid 3033) is running...
hpssd (pid 3038) is running...
Firewall is stopped.
ipmi_msghandler module not loaded.
ipmi_si module not loaded.
ipmi_devintf module not loaded.
/dev/ipmi0 does not exist.
Firewall is stopped.
irattach is stopped
irqbalance is stopped
Kdump is not operational
krb524d is stopped
mcstransd is stopped
mdadm is stopped
mdmpd is stopped
dbus-daemon (pid 2805) is running...
multipathd is stopped
netconsole module not loaded
netplugd is stopped
Configured devices:
lo eth0
Currently active devices:
lo eth0
NetworkManager is stopped
rpc.mountd is stopped
nfsd is stopped
rpc.rquotad is stopped
rpc.statd (pid  2746) is running...
nscd is stopped
ntpd is stopped
pand is stopped
pcscd (pid  2900) is running...
portmap (pid 2709) is running...
Process accounting is disabled.
rdisc is stopped
rpc.idmapd (pid 2780) is running...
saslauthd is stopped
sendmail (pid  3113) is running...
setroubleshootd is stopped
smartd (pid 3274) is running...
openssh-daemon (pid  3056) is running...
syslogd (pid  2671) is running...
klogd (pid  2674) is running...
Xvnc is stopped
wdaemon is stopped
winbindd is stopped
wpa_supplicant is stopped
xfs (pid  3184) is running...
xinetd (pid  3089) is running...
ypbind is stopped
yum-updatesd (pid 3334) is running...



No comments:

Post a Comment