Red Hat Linux Reference Guide

Linux Introduction

VI-EDITOR

Process Management

Linux Installation

Disk Partitions & File System Management

Logical Volume Management - LVM

User & Group Administration

Package Management

Network File System - NFS

Domain Naming System - DNS

Apache HTTP Web Server

KickStart Installations

FTP server

BOOT PROCESS

Dynamic Host Configuration Protocol - DHCP

Job Scheduling

File Links

Swap Management

Log Management

Performance Management

Linux Troubleshooting

Linux Summary

Start Preparation Smartly

We have the collection to start prepartion smartly.

Start Assessment

Red Hat Linux Reference Guide

  DevOps Tech Hub

116 Followers

Linux Process Management


How to see list of Processes running ?

[kloudway@ ~]$ps -ef
UID        PID  PPID  C STIME TTY          TIME CMD
root         2     0  0 13:00 ?        00:00:00 [kthreadd]
root         4     2  0 13:00 ?        00:00:00 [kworker/0:0H]
root         5     2  0 13:00 ?        00:00:00 [kworker/u30:0]
root         6     2  0 13:00 ?        00:00:00 [mm_percpu_wq]
root         7     2  0 13:00 ?        00:00:00 [ksoftirqd/0]
root         8     2  0 13:00 ?        00:00:00 [rcu_sched]
root         9     2  0 13:00 ?        00:00:00 [rcu_bh]
root        10     2  0 13:00 ?        00:00:00 [migration/0]

How to kill a process?

[kloudway@ ~]$kill 432  #Here 432 is the Process ID
[kloudway@ ~]$

How to see List of Top Processes consuming more Computing Resources

[kloudway@ ~]$ top
    PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND
    1 root      20   0  125568   5328   3892 S  0.0  0.5   0:01.74 systemd
    2 root      20   0       0      0      0 S  0.0  0.0   0:00.00 kthreadd
    4 root       0 -20       0      0      0 I  0.0  0.0   0:00.00 kworker/0:0H
    5 root      20   0       0      0      0 I  0.0  0.0   0:00.04 kworker/u30:0
    6 root       0 -20       0      0      0 I  0.0  0.0   0:00.00 mm_percpu_wq
    7 root      20   0       0      0      0 S  0.0  0.0   0:00.11 ksoftirqd/0
    8 root      20   0       0      0      0 I  0.0  0.0   0:00.17 rcu_sched
    9 root      20   0       0      0      0 I  0.0  0.0   0:00.00 rcu_bh
   10 root      rt   0       0      0      0 S  0.0  0.0   0:00.00 migration/0

How to see Linux Process State - Sleep(s), Running(R),, Zombie(Z)

[kloudway@ ~]$ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.5 125568  5328 ?        Ss   13:00   0:01 /usr/lib/systemd/systemd --swit
root         2  0.0  0.0      0     0 ?        S    13:00   0:00 [kthreadd]
root         4  0.0  0.0      0     0 ?        I<   13:00   0:00 [kworker/0:0H]
root         5  0.0  0.0      0     0 ?        I    13:00   0:00 [kworker/u30:0]
root         6  0.0  0.0      0     0 ?        I<   13:00   0:00 [mm_percpu_wq]
root         7  0.0  0.0      0     0 ?        S    13:00   0:00 [ksoftirqd/0]
root         8  0.0  0.0      0     0 ?        I    13:00   0:00 [rcu_sched]

What is Service?

  • A Process which is  running continuously on the system is called as service. Service program usually  start at booting time and  ends only at  server shutdown time.
  • Service is the responsible process to  serve certain services to the client applications. 
  • Service process can be controlled using 'service or systemctl' command.
  • It is possible to start/stop/restart a service during the session as per the requirements.
  • service is also called as daemon.

Examples:  httpd, vsftpd, sshd etc...

What is chkconfig?

  • chkconfig is the command to  control the service  startup  behavior at the time of system boot time.
  • Its possible to  control weather the service needs to be started or not at the time of system boot using chkconfig

Commands used  to  control a service:

Syntax:

  • #service <name of the service> status --- To check the status of the service
  • #service <name of the service> start --- To start the service
  • #service <name of the service > stop --- To stop a service
  • #service <name of the service> reload --- To reload the service
  • #service <name of the service> restart --- To restart the service

Examples:

  • service sshd status
  • service sshd start
  • service sshd stop
  • service sshd reload
  • service sshd restart

How to  use chkconfig?

Syntax:

  • #chkconfig - -list --- To check the availability of service
  • #chkconfig <service> on --- To make the service available after restart
  • #chkconfig <service> off --- To make the service unavailable after restart

Examples:

  • #chkconfig --list
  • #chkconfig htpd on
  • #chkconfig httpd off



Previous Next