Linux/Linux 실습

yum 프로세스 강제 종료

GGkeeper 2021. 11. 6. 22:49

실습> kill 프로세스 강제 종료

yum은 하나만 실행할 수 있다.

1. yum 실행
yum을 실행한 후 바로 중지한다. (ctrl + z)
/dev/pts/0# yum -y install mc

  :
  :

[1]+  Stopped                 yum -y install mc

2. yum 실행

첫 번째 터미널에서 yum이 멈춰있으므로 yum 실행이 안된다.

다른 쉘에서 실행
/dev/pts/1# yum -y install mc


Loaded plugins: fastestmirror
Existing lock /var/run/yum.pid: another copy is running as pid 2794.
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory :  33 M RSS (574 MB VSZ)
    Started: Mon Nov  1 18:03:00 2021 - 00:24 ago
    State  : Traced/Stopped, pid: 2794
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory :  33 M RSS (574 MB VSZ)
    Started: Mon Nov  1 18:03:00 2021 - 00:26 ago
    State  : Traced/Stopped, pid: 2794
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory :  33 M RSS (574 MB VSZ)
    Started: Mon Nov  1 18:03:00 2021 - 00:28 ago
    State  : Traced/Stopped, pid: 2794
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory :  33 M RSS (574 MB VSZ)
    Started: Mon Nov  1 18:03:00 2021 - 00:30 ago
    State  : Traced/Stopped, pid: 2794
Another app is currently holding the yum lock; waiting for it to exit...
  The other application is: yum
    Memory :  33 M RSS (574 MB VSZ)
    Started: Mon Nov  1 18:03:00 2021 - 00:32 ago
    State  : Traced/Stopped, pid: 2794
^C

3. 프로세스 확인
전체 프로세스에서 yum (문자열을 검색한다)을 실행한 PID를 확인한다. 
/dev/pts/1# ps aux | grep yum
root       2794  0.0  7.0 588136 33892 pts/0    T    18:03   0:00 /usr/bin/python /usr/bin/yum -y install mc
root       2802  0.0  0.2 116972  1008 pts/1    S+   18:08   0:00 grep --color=auto yum

4. 프로세스 종료
전체 프로세스에서 검색된 강제 PID를 종료
/dev/pts/1# kill -9 2794

/dev/pts/0# <ENTER>
[1]+  죽었음               yum -y install mc

5. 패키지 설치
메모리에 yum이 없으므로 mc 패키지를 설치할 수 있다.
/dev/pts/1# yum -y install mc
  :
  :


Installed:
  mc.x86_64 1:4.8.7-11.el7

Dependency Installed:
  gpm-libs.x86_64 0:1.20.7-6.el7

Complete!