How to See What Services Are Running on Linux
There are many means equally well as tools to cheque and listing all running services in Linux.
Most Linux administrators typically use 'service service_name status' or '/etc/init.d/service_name status' for the System V (SysV) init system, and 'systemctl condition service_name' for the systemd systems for a specific service.
The higher up commands show whether the particular service is running on the server or not. These are frequently used commands past every Linux ambassador.
If you are new to the surroundings and want to know what services are running on the system, proceed to read.
The following commands lists all the services running on the system and give you lot an idea of what purpose the system is being used for. Also, it provides an opportunity to disable certain services that are non used on the system.
'init' (brusk for initialization) is the beginning process started during booting of the reckoner system. init is a daemon process that continues running until the system is shut down.
We recommend reading the following articles related to this topic.
- How to configure systemd to beginning a service automatically subsequently a crash in Linux
- Fustigate script to automatically start a services when information technology goes downward on Linux
- How to determine which arrangement manager is running on Linux System
- How to Enable / Disable services on Kicking in Linux using chkconfig and systemctl commands?
- SysVinit Vs systemd Cheatsheet
Many init systems have been developed for Linux, just the following are the three almost familiar and commonly used init systems.
- System V (Sys V) is the older init system
- Upstart is an event-based replacement for the traditional init system
- systemd is the new init system, that was adopted by about of the latest Linux distributions
Method-ane: Listing Linux Running Services with service command
To display the status of all available services at once in the System 5 (SysV) init organisation, run the service command with the --condition-all option:
If you have multiple services, utilise file display commands (like less or more) for page-wise viewing. The post-obit command will evidence the beneath information in the output.
- Running services and their associated PID
- Stopped services
- Configured iptables rules
- Configured and active network interface information.
# service --status-all or # service --status-all | more or # service --status-all | less abrt-ccpp hook is installed abrtd (pid 2131) is running... abrt-dump-oops is stopped acpid (pid 1958) is running... atd (pid 2164) is running... auditd (pid 1731) is running... Frequency scaling enabled using ondemand governor crond (pid 2153) is running... hald (pid 1967) is running... htcacheclean is stopped httpd is stopped Tabular array: filter Chain INPUT (policy ACCEPT) num target prot opt source destination ane Take all ::/0 ::/0 state RELATED,ESTABLISHED 2 ACCEPT icmpv6 ::/0 ::/0 3 ACCEPT all ::/0 ::/0 four ACCEPT tcp ::/0 ::/0 land NEW tcp dpt:eighty 5 Have tcp ::/0 ::/0 state NEW tcp dpt:21 6 Take tcp ::/0 ::/0 state NEW tcp dpt:22 7 Have tcp ::/0 ::/0 land NEW tcp dpt:25 8 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:2082 9 ACCEPT tcp ::/0 ::/0 state NEW tcp dpt:2086 ten Take tcp ::/0 ::/0 state NEW tcp dpt:2083 11 Have tcp ::/0 ::/0 state NEW tcp dpt:2087 12 ACCEPT tcp ::/0 ::/0 land NEW tcp dpt:10000 13 REJECT all ::/0 ::/0 reject-with icmp6-adm-prohibited Concatenation Forrad (policy ACCEPT) num target prot opt source destination 1 REJECT all ::/0 ::/0 pass up-with icmp6-adm-prohibited Chain OUTPUT (policy ACCEPT) num target prot opt source destination iptables: Firewall is non running. irqbalance (pid 1826) is running... Kdump is operational lvmetad is stopped mdmonitor is stopped messagebus (pid 1929) is running... SUCCESS! MySQL running (24376) rndc: neither /etc/rndc.conf nor /etc/rndc.key was establish named is stopped netconsole module not loaded Usage: startup.sh { start | stop } Configured devices: lo eth0 eth1 Currently active devices: lo eth0 ntpd is stopped portreserve (pid 1749) is running... primary (pid 2107) is running... Process bookkeeping is disabled. quota_nld is stopped rdisc is stopped rngd is stopped rpcbind (pid 1840) is running... rsyslogd (pid 1756) is running... sandbox is stopped saslauthd is stopped smartd is stopped openssh-daemon (pid 9859) is running... svnserve is stopped vsftpd (pid 4008) is running... xinetd (pid 2031) is running... zabbix_agentd (pid 2150 2149 2148 2147 2146 2140) is running... Run the following command to run into only running services in the system.
# service --status-all | grep running crond (pid 535) is running... httpd (pid 627) is running... mysqld (pid 911) is running... rndc: neither /etc/rndc.conf nor /etc/rndc.key was found rsyslogd (pid 449) is running... saslauthd (pid 492) is running... sendmail (pid 509) is running... sm-client (pid 519) is running... openssh-daemon (pid 478) is running... xinetd (pid 485) is running...
Run the following command to see the specified service status. For instance, use the following command to cheque the Apache Web server status on a RHEL based arrangement.
# service --status-all | grep httpd httpd (pid 627) is running...
To determine the current status of a detail service, execute the following control.
# service httpd status httpd (pid 627) is running...
Use the following control to see a list of services that were enabled on boot. These services will exist kicked on equally part of the organization boot procedure.
# chkconfig --list crond 0:off 1:off 2:on iii:on iv:on v:on half dozen:off htcacheclean 0:off i:off ii:off 3:off 4:off 5:off half-dozen:off httpd 0:off 1:off 2:off 3:on 4:off 5:off half-dozen:off ip6tables 0:off ane:off two:on 3:off 4:on 5:on half-dozen:off iptables 0:off i:off 2:on 3:on 4:on 5:on half-dozen:off modules_dep 0:off 1:off 2:on three:on four:on five:on 6:off mysqld 0:off ane:off 2:on 3:on 4:on 5:on 6:off named 0:off 1:off two:off 3:off 4:off 5:off 6:off netconsole 0:off 1:off ii:off 3:off iv:off 5:off vi:off netfs 0:off 1:off 2:off three:off 4:on 5:on 6:off network 0:off 1:off 2:on 3:on 4:on five:on 6:off nmb 0:off 1:off 2:off iii:off 4:off 5:off six:off nscd 0:off 1:off ii:off 3:off 4:off 5:off 6:off portreserve 0:off 1:off 2:on iii:off iv:on 5:on six:off quota_nld 0:off ane:off 2:off 3:off iv:off 5:off 6:off rdisc 0:off 1:off 2:off 3:off 4:off 5:off half-dozen:off restorecond 0:off 1:off 2:off 3:off iv:off five:off 6:off rpcbind 0:off 1:off ii:on 3:off iv:on v:on 6:off rsyslog 0:off ane:off two:on 3:on iv:on 5:on 6:off saslauthd 0:off 1:off 2:off three:on 4:off 5:off 6:off sendmail 0:off i:off 2:on 3:on 4:on 5:on 6:off smb 0:off i:off two:off 3:off iv:off five:off 6:off snmpd 0:off ane:off two:off 3:off 4:off 5:off 6:off snmptrapd 0:off 1:off 2:off 3:off 4:off 5:off half-dozen:off sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off udev-postal service 0:off one:on 2:on three:off 4:on 5:on 6:off winbind 0:off one:off 2:off three:off 4:off 5:off vi:off xinetd 0:off one:off 2:off 3:on four:on v:on six:off xinetd based services: chargen-dgram: off chargen-stream: off daytime-dgram: off daytime-stream: off discard-dgram: off discard-stream: off echo-dgram: off echo-stream: off finger: off ntalk: off rsync: off talk: off tcpmux-server: off fourth dimension-dgram: off time-stream: off
Method-1(a): How to cheque running services in System V (SysV) init Arrangement
Alternatively, y'all tin can view services running on a Linux system by issuing the 'initctl' command as shown below.
# initctl list rc stop/waiting tty (/dev/tty3) start/running, process 1740 tty (/dev/tty2) start/running, process 1738 tty (/dev/tty1) start/running, process 1736 tty (/dev/tty6) start/running, process 1746 tty (/dev/tty5) get-go/running, process 1744 tty (/dev/tty4) start/running, process 1742 plymouth-shutdown stop/waiting control-alt-delete stop/waiting rcS-emergency finish/waiting readahead-collector end/waiting kexec-disable stop/waiting quit-plymouth stop/waiting rcS stop/waiting prefdm stop/waiting init-system-dbus end/waiting ck-log-organisation-restart terminate/waiting readahead end/waiting ck-log-system-start stop/waiting splash-manager cease/waiting start-ttys finish/waiting readahead-disable-services cease/waiting ck-log-system-stop stop/waiting rcS-sulogin cease/waiting series finish/waiting
Method-1(b): How to check running services in Linux with pstree command
Run the 'pstree' command without any boosted parameter to run into services running in the Linux system:
# pstree init-+-crond |-httpd---two*[httpd] |-kthreadd/99149---khelper/99149 |-ii*[mingetty] |-mysqld_safe---mysqld---ix*[{mysqld}] |-rsyslogd---3*[{rsyslogd}] |-saslauthd---saslauthd |-two*[sendmail] |-sshd---sshd---bash---pstree |-udevd `-xinetd Method-2: How to check running services in systemd organization using the systemctl command
'systemctl' command allows users to bank check and list all services running in a Linux arrangement that uses "systemd" as the organisation manager.
# systemctl UNIT LOAD ACTIVE SUB Description sys-devices-virtual-block-loop0.device loaded agile plugged /sys/devices/virtual/block/loop0 sys-devices-virtual-block-loop1.device loaded agile plugged /sys/devices/virtual/cake/loop1 sys-devices-virtual-block-loop2.device loaded agile plugged /sys/devices/virtual/block/loop2 sys-devices-virtual-block-loop3.device loaded active plugged /sys/devices/virtual/block/loop3 sys-devices-virtual-block-loop4.device loaded active plugged /sys/devices/virtual/block/loop4 sys-devices-virtual-misc-rfkill.device loaded active plugged /sys/devices/virtual/misc/rfkill sys-devices-virtual-tty-ttyprintk.device loaded active plugged /sys/devices/virtual/tty/ttyprintk sys-module-fuse.device loaded active plugged /sys/module/fuse sys-subsystem-cyberspace-devices-enp0s3.device loaded agile plugged 82540EM Gigabit Ethernet Controller (PRO/1000 MT Desktop Adapter) -.mount loaded active mounted Root Mount dev-hugepages.mount loaded active mounted Huge Pages File System dev-mqueue.mount loaded agile mounted POSIX Message Queue File Arrangement run-user-1000-gvfs.mount loaded agile mounted /run/user/k/gvfs run-user-yard.mountain loaded active mounted /run/user/1000 snap-core-3887.mount loaded active mounted Mount unit for cadre snap-core-4017.mountain loaded agile mounted Mount unit for core snap-core-4110.mount loaded active mounted Mount unit for core snap-gping-13.mount loaded active mounted Mount unit for gping snap-termius\x2dapp-8.mountain loaded active mounted Mountain unit for termius-app sys-fs-fuse-connections.mount loaded active mounted FUSE Control File Organisation sys-kernel-debug.mountain loaded active mounted Debug File System acpid.path loaded active running ACPI Events Check cups.path loaded agile running CUPS Scheduler systemd-ask-password-plymouth.path loaded agile waiting Forward Password Requests to Plymouth Directory Picket systemd-ask-countersign-wall.path loaded active waiting Forwards Countersign Requests to Wall Directory Watch init.scope loaded agile running Organization and Service Manager session-c2.scope loaded active running Session c2 of user magi accounts-daemon.service loaded active running Accounts Service acpid.service loaded active running ACPI event daemon anacron.service loaded active running Run anacron jobs apache2.service loaded agile running The Apache HTTP Server apparmor.service loaded active exited AppArmor initialization apport.service loaded active exited LSB: automatic crash report generation aptik-battery-monitor.service loaded active running LSB: showtime/stop the aptik battery monitor daemon atop.service loaded agile running Atop advanced functioning monitor atopacct.service loaded active running Atop process accounting daemon avahi-daemon.service loaded active running Avahi mDNS/DNS-SD Stack colord.service loaded agile running Manage, Install and Generate Colour Profiles console-setup.service loaded active exited Set up console font and keymap cron.service loaded agile running Regular background program processing daemon cups-browsed.service loaded active running Brand remote CUPS printers available locally cups.service loaded active running CUPS Scheduler dbus.service loaded active running D-Bus Arrangement Message Motorbus postfix.service loaded active exited Postfix Post Transport Agent
-
UNITDescribe almost the corresponding systemd unit name. -
LOADDescribes whether the corresponding unit currently loaded in memory or not. -
ACTIVESignal whether the unit is active or not. -
SUBIndicate whether the unit is in running state or not. -
DESCRIPTIONA short description about the unit.
To see loaded service in the organization, utilize the list-units subcommand and the --type switch with a value of service. Information technology shows active, running, exited or failed services in the output.
# systemctl listing-units --type service Unit of measurement LOAD ACTIVE SUB DESCRIPTION accounts-daemon.service loaded active running Accounts Service acpid.service loaded active running ACPI event daemon anacron.service loaded active running Run anacron jobs apache2.service loaded agile running The Apache HTTP Server apparmor.service loaded agile exited AppArmor initialization apport.service loaded agile exited LSB: automatic crash report generation aptik-battery-monitor.service loaded agile running LSB: kickoff/stop the aptik bombardment monitor daemon atop.service loaded agile running Atop advanced performance monitor atopacct.service loaded active running Atop process bookkeeping daemon avahi-daemon.service loaded agile running Avahi mDNS/DNS-SD Stack colord.service loaded active running Manage, Install and Generate Color Profiles console-setup.service loaded active exited Set console font and keymap cron.service loaded agile running Regular background program processing daemon cups-browsed.service loaded agile running Brand remote CUPS printers available locally cups.service loaded active running CUPS Scheduler dbus.service loaded active running D-Bus Organization Message Autobus fwupd.service loaded active running Firmware update daemon [e-mail protected] loaded active running Getty on tty1 grub-common.service loaded agile exited LSB: Record successful kicking for Grub irqbalance.service loaded active running LSB: daemon to balance interrupts for SMP systems keyboard-setup.service loaded active exited Prepare the panel keyboard layout kmod-static-nodes.service loaded agile exited Create list of required static device nodes for the current kernel
Run the following control to view a particular service status.
# systemctl | grep apache2 apache2.service loaded active running The Apache HTTP Server
Detailed information virtually a item service tin can be verified with the systemctl command as shown below.
# systemctl condition apache2 ● apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Drop-In: /lib/systemd/arrangement/apache2.service.d └─apache2-systemd.conf Active: agile (running) since Tue 2018-03-06 12:34:09 IST; 8min ago Process: 2786 ExecReload=/usr/sbin/apachectl svelte (code=exited, status=0/SUCCESS) Main PID: 1171 (apache2) Tasks: 55 (limit: 4915) CGroup: /organization.piece/apache2.service ├─1171 /usr/sbin/apache2 -yard start ├─2790 /usr/sbin/apache2 -one thousand kickoff └─2791 /usr/sbin/apache2 -m start Mar 06 12:34:08 magi-VirtualBox systemd[ane]: Starting The Apache HTTP Server... Mar 06 12:34:09 magi-VirtualBox apachectl[1089]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using x.0.2.15. Set the 'ServerName' directive globally to suppre Mar 06 12:34:09 magi-VirtualBox systemd[1]: Started The Apache HTTP Server. Mar 06 12:39:x magi-VirtualBox systemd[1]: Reloading The Apache HTTP Server. Mar 06 12:39:10 magi-VirtualBox apachectl[2786]: AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using fe80::7929:4ed1:279f:4d65. Set the 'ServerName' directive gl Mar 06 12:39:10 magi-VirtualBox systemd[1]: Reloaded The Apache HTTP Server.
Run the post-obit command to view the services running on the system with the systemctl command:
# systemctl list-units --type=service --state=running or # systemctl | grep running acpid.path loaded active running ACPI Events Cheque cups.path loaded agile running CUPS Scheduler init.scope loaded agile running Arrangement and Service Manager session-c2.scope loaded active running Session c2 of user magi accounts-daemon.service loaded active running Accounts Service acpid.service loaded active running ACPI event daemon apache2.service loaded active running The Apache HTTP Server aptik-bombardment-monitor.service loaded active running LSB: offset/stop the aptik bombardment monitor daemon atop.service loaded active running Atop advanced performance monitor atopacct.service loaded active running Atop procedure accounting daemon avahi-daemon.service loaded active running Avahi mDNS/DNS-SD Stack colord.service loaded active running Manage, Install and Generate Color Profiles cron.service loaded agile running Regular groundwork programme processing daemon cups-browsed.service loaded active running Make remote CUPS printers available locally cups.service loaded active running CUPS Scheduler dbus.service loaded active running D-Autobus Organization Bulletin Double-decker fwupd.service loaded agile running Firmware update daemon [email protected] loaded active running Getty on tty1 irqbalance.service loaded active running LSB: daemon to balance interrupts for SMP systems lightdm.service loaded active running Light Display Manager ModemManager.service loaded active running Modem Manager NetworkManager.service loaded active running Network Manager polkit.service loaded agile running Authorisation Managing director
Use the below command to see which services were enabled on kick:
# systemctl list-unit-files --state=enabled acpid.path enabled cups.path enabled accounts-daemon.service enabled anacron-resume.service enabled anacron.service enabled apache2.service enabled apparmor.service enabled atop.service enabled atopacct.service enabled [email protected] enabled avahi-daemon.service enabled bluetooth.service enabled panel-setup.service enabled cron.service enabled cups-browsed.service enabled cups.service enabled display-manager.service enabled dns-clean.service enabled friendly-recovery.service enabled [e-mail protected] enabled gpu-manager.service enabled keyboard-setup.service enabled lightdm.service enabled ModemManager.service enabled network-manager.service enabled networking.service enabled NetworkManager-dispatcher.service enabled NetworkManager-await-online.service enabled NetworkManager.service enabled
systemd-cgtop shows peak control groups by their resources usage such as tasks, CPU, Retention, Input, and Output:
# systemd-cgtop Control Group Tasks %CPU Retentivity Input/s Output/south / - - 1.5G - - /init.scope 1 - - - - /organisation.piece 153 - - - - /organization.piece/ModemManager.service 3 - - - - /organisation.slice/NetworkManager.service 4 - - - - /arrangement.slice/accounts-daemon.service 3 - - - - /system.slice/acpid.service 1 - - - - /organisation.slice/apache2.service 55 - - - - /system.slice/aptik-bombardment-monitor.service 1 - - - - /system.slice/atop.service 1 - - - - /system.piece/atopacct.service i - - - - /system.slice/avahi-daemon.service two - - - - /system.slice/colord.service 3 - - - - /system.piece/cron.service 1 - - - - /arrangement.slice/cups-browsed.service 3 - - - - /system.slice/cups.service ii - - - - /arrangement.piece/dbus.service 6 - - - - /system.piece/fwupd.service five - - - - /organization.slice/irqbalance.service 1 - - - - /organization.piece/lightdm.service 7 - - - - /arrangement.piece/polkit.service 3 - - - - /system.piece/repowerd.service 14 - - - - /system.slice/rsyslog.service four - - - - /system.slice/rtkit-daemon.service 3 - - - - /system.slice/snapd.service 8 - - - - /system.slice/system-getty.slice ane - - - -
Method-2(a): List Linux services with pstree command
Listing of services running in a Linux system can be verified using the 'pstree' control equally shown below.
# pstree systemd─┬─ModemManager─┬─{gdbus} │ └─{gmain} ├─NetworkManager─┬─dhclient │ ├─{gdbus} │ └─{gmain} ├─accounts-daemon─┬─{gdbus} │ └─{gmain} ├─acpid ├─agetty ├─anacron ├─apache2───2*[apache2───26*[{apache2}]] ├─aptd───{gmain} ├─aptik-battery-g ├─atop ├─atopacctd ├─avahi-daemon───avahi-daemon ├─colord─┬─{gdbus} │ └─{gmain} ├─cron ├─cups-browsed─┬─{gdbus} │ └─{gmain} ├─cupsd ├─dbus-daemon ├─fwupd─┬─{GUsbEventThread} │ ├─{fwupd} │ ├─{gdbus} │ └─{gmain} ├─gnome-keyring-d─┬─{gdbus} │ ├─{gmain} │ └─{timer} Method-2(b): List Linux Services with chkservice control
chkservice is a new tool for managing systemd units in last. It requires super user privileges to manage the units.
# chkservice
To view the assist page, hit '?' button. This will evidence you available options to manage the systemd services.
Conclusion
This article explained several ways to cheque and list all running Linux services.
If you take any questions or feedback, feel free to comment beneath.
Source: https://www.2daygeek.com/how-to-check-all-running-services-in-linux/
Post a Comment for "How to See What Services Are Running on Linux"